:root {
    --primary-orange: #d97706; /* brand orange */
    --text-dark: #2d2d2d; /* headings */
    --text-light: #666; /* secondary text */
    --bg-light: #fdfdfd; /* page background */
    --white: #ffffff; /* cards */
    
    /* extra helpers */
    --border: #eeeeee;
    --orange-soft: #fff3e6;
    --shadow: 0 12px 30px rgba(0,0,0,.06);
    --radius: 18px;
    --container: 1100px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ===== Header / Nav ===== */
.main-header{
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(253,253,253,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 16px;
}

.logo{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text-dark);
}

.logo-img{ width: 40px; height: 40px; object-fit: contain; }

.highlight-logo{
    color: var(--primary-orange);
    padding-bottom: 2px;
} 
.main-nav .nav-list{
    list-style: none;
    display: flex;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.main-nav a{
    width: 100%;
    padding: 10px 10px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover{
    background: transparent;
    color: var(--primary-orange);
}
.main-nav a.active{
    background: transparent;
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
}

.habits-grid{ grid-template-columns: 1fr; }

/* Hamburger - hidden by default (desktop/tablet) */
.nav-toggle{
    display: none;
    width: 44px;
    height: 44px;
    border: 1px var(--border);
    border-radius: 12px;
    background: var(--white);
    align-items: center;
    justify-content: center;
    flex-direction: column; /* lines stacked */
    gap: 6px;
    padding: 10px;
}
.nav-toggle span{
    display: block;
    width: 22px; /* אורך הקו */
    height: 3px; /* עובי הקו */
    background: var(--text-dark);
    border-radius: 4px;
}
    
/* רווח אנכי בין הקווים */
.nav-toggle{
    gap: 6px;
}

.nav-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 40;
    display: none;
}

body.menu-open .main-nav{ transform: translateX(0); }
body.menu-open .nav-backdrop{ display: block; }
    
/* ===== Main Layout ===== */
.habits-wrapper{
    width: min(var(--container), calc(100% - 40px));
    margin: 26px auto 60px;
}
    
.page-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-header h1{ margin: 0; font-size: 34px; }
.page-header p{ margin: 6px 0 0; color: var(--text-light); }

.btn-add-habit{
    border-radius: 999px;
    padding: 12px 16px;
    border: 1px solid var(--text-dark);
    background: var(--text-dark); /* black */
    color: var(--white);
    font-weight: 800;
}

/* Filters */
.filters{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 22px;
}

.filter-btn{
    border: 1px solid var(--border);
    background: var(--white);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    color: var(--text-light);
}
.filter-btn:hover{ background: var(--orange-soft); }

.filter-btn.active{
    background: var(--primary-orange);
    color: var(--white);
    border-color: var(--primary-orange);
}

/* Habits grid */
.habits-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
    
.habit-card{
    position: relative;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px 18px 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,.04);
}

.btn-edit{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-light);
    display: grid;
    place-items: center;
    padding: 0;
}

.btn-edit:hover{color: var(--primary-orange);}
.btn-edit:focus-visible{
    outline: 2px solid var(--primary-orange);
    outline-offset: 3px;
    border-radius: 10px;
}

.habit-icon{
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #f6f6f6;
    object-fit: contain ;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.habit-card .habit-icon{ margin-bottom: 12px; }

/*delete exists in Edit modal*/
.btn-delete{ display: none !important; }

.habit-info .habit-title{ margin: 12px 0 6px; font-size: 20px; }

.category{
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f6f6f6;
    color: var(--text-light);
    font-weight: 700;
    font-size: 13px;
}

.habit-footer{
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.streak-badge{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    border-radius: 20px;
    background-color: var(--orange-soft);
    color: var(--primary-orange); /* orange text */
}

.btn-status{
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    padding: 10px 12px;
    font-weight: 800;
    color: var(--text-dark);
}

.btn-status:hover{
    background: var(--orange-soft);
    border-color: var(--primary-orange);
    color: var(--text-dark);
}

.habit-card.completed{
    border-color: var(--border);
}

.habit-card.completed .btn-status{
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
}
.habit-card.completed .btn-status::after{ content: " ✓"; }
   
/* Toast */
.toast{
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: var(--text-dark); 
    border: none;
    box-shadow: var(--shadow);
    border-radius: 16px;
    padding: 14px 18px;
    z-index: 80;
}

.toast.hidden{ display: none; }
.toast-content{
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.toast-check{
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--primary-orange);
    border: 1px solid var(--orange-soft);
    color: var(--white);
    font-weight: 900;
}

/* Modal basics */
.modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 90;
}
.modal-overlay.hidden{ display: none; }
.modal-content{
    width: min(520px, 100%);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
}

.btn-close-modal{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
}

.btn-close-modal:hover{ background: var(--orange-soft); color: var(--primary-orange); }

.form-group{ display: grid; gap: 8px; margin: 12px 0; }

label{ font-weight: 700; color: var(--text-dark); }

input, select{
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-light);
}

/* Modal actions (Cancel | Create centered | Delete) */
.modal-actions{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}

.modal-actions .btn-cancel{
    border: 1px solid var(--border);
    background: var(--white);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    color: var(--text-dark);
}

.modal-actions .btn-create{
    margin: 0 auto; /* center primary action */
    border: 1px solid var(--primary-orange);
    background: var(--primary-orange);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 900;
}

.modal-actions .btn-danger{
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--text-dark);
    background: transparent;
    color: var(--text-dark);
    font-weight: 800;
}
.modal-actions .btn-danger:hover{
    background: var(--text-dark);
    color: var(--white);
}
    

.site-footer{
    padding: 26px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: #9a9a9a;
    font-size: 14px;
}


/* ===== Responsive ===== */
@media (max-width: 900px){
    .habits-grid{ grid-template-columns: repeat(2, 1fr); }
    .page-header{ flex-direction: column; align-items: flex-start; }
}
    
@media (max-width: 640px){
    .habits-wrapper{ width: calc(100% - 28px); }
    
    .nav-toggle{ display:flex; }
    
    .main-nav{
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(78vw, 320px);
        background: var(--white);
        border-left: 1px solid var(--border);
        box-shadow: -18px 0 40px rgba(0,0,0,.08);
        padding: 84px 18px 18px;
        transform: translateX(105%);
        transition: transform .25s ease;
        z-index: 60;
    }

    .main-nav .nav-list{
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
        
    .main-nav a{
        width: 100%;
        padding: 10px 10px;
        border-radius: 12px;
        border-bottom: none;
    }

    .main-nav a:hover{ background:transparent; color:  var(--orange-soft); }
    .main-nav a.active{ background: transparent; color: var(--primary-orange); text-decoration: underline; text-underline-offset: 6px; }  
     
    .habits-grid{ grid-template-columns: 1fr; }
}


    







    



    
    


    