@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

*{
    box-sizing:border-box;
}

:root{
    --tyt-purple:#5b17d6;
    --tyt-purple-dark:#2f0f73;
    --tyt-purple-soft:#efe7ff;
    --tyt-gold:#f4c21f;
    --tyt-gold-dark:#d9a90a;
    --tyt-text:#1f1f2e;
    --tyt-subtext:#625f74;
    --tyt-white:#ffffff;
    --tyt-border:#ece7f7;
    --tyt-bg:#f7f5fc;
    --tyt-card-shadow:0 14px 34px rgba(63, 24, 132, 0.08);
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Poppins',sans-serif;
    margin:0;
    background:linear-gradient(180deg,#faf8ff 0%, #f6f3fc 100%);
    color:var(--tyt-text);
}

/* NAVBAR */
.navbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:15px 8%;
    position:sticky;
    top:0;
    z-index:3000;
    background:rgba(255,255,255,0.82);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    box-shadow:0 6px 24px rgba(53,23,108,0.06);
    border-bottom:1px solid rgba(91,23,214,0.06);
}

.left-section{
    display:flex;
    align-items:center;
    gap:10px;
}

.right-section{
    display:flex;
    align-items:center;
    gap:15px;
    position:relative;
}

.logo img{
    height:45px;
    display:block;
}

/* DESKTOP NAV */
.desktop-nav{
    display:flex;
    align-items:center;
    gap:30px;
}

.desktop-nav a{
    text-decoration:none;
    color:#342d4f;
    font-weight:600;
    position:relative;
    padding-bottom:5px;
    transition:0.25s ease;
}

.desktop-nav a::after{
    content:"";
    position:absolute;
    bottom:-6px;
    left:0;
    width:0%;
    height:3px;
    border-radius:999px;
    background:linear-gradient(90deg,var(--tyt-purple),var(--tyt-gold));
    transition:0.3s;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after{
    width:100%;
}

.desktop-nav a.active{
    color:var(--tyt-purple-dark);
}

/* MOBILE MENU */
.nav-center{
    display:none;
}

.nav-center nav{
    display:flex;
    flex-direction:column;
    width:100%;
}

.nav-center nav a{
    display:flex;
    align-items:center;
    gap:12px;
    text-decoration:none;
    color:#777;
    font-weight:500;
    width:100%;
}

.nav-center nav a i{
    width:20px;
    height:20px;
    color:#5f4f7f;
    flex-shrink:0;
}

/* SEARCH */
.search-bar{
    padding:10px 15px;
    border-radius:999px;
    border:1px solid #e6def7;
    width:210px;
    transition:0.3s;
    font-family:'Poppins',sans-serif;
    background:#fff;
    color:var(--tyt-text);
}

.search-bar::placeholder{
    color:#8f88a4;
}

.search-bar:focus{
    outline:none;
    border-color:rgba(91,23,214,0.35);
    box-shadow:0 0 0 4px rgba(91,23,214,0.08);
}

.desktop-search{
    display:block;
}

#mobileSearch{
    display:none;
}

.search-icon{
    display:none;
    cursor:pointer;
    align-items:center;
    justify-content:center;
}

.search-icon i{
    width:22px;
    height:22px;
    color:#433d55;
}

/* LOGIN BUTTON */
.login-btn a{
    text-decoration:none;
    background:linear-gradient(135deg,var(--tyt-gold),#ffd95a);
    color:#221b07;
    padding:11px 20px;
    border-radius:999px;
    font-weight:700;
    transition:0.25s ease;
    box-shadow:0 10px 20px rgba(244,194,31,0.22);
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.login-btn a:hover{
    transform:translateY(-1px);
    background:linear-gradient(135deg,var(--tyt-purple),#7b39f2);
    color:white;
    box-shadow:0 12px 22px rgba(91,23,214,0.22);
}

/* HAMBURGER */
.hamburger{
    display:none;
    cursor:pointer;
    align-items:center;
    justify-content:center;
}

.hamburger i{
    width:24px;
    height:24px;
    color:#433d55;
}

/* TOP SECTION */
.materials-top{
    padding:34px 8% 20px;
}

.materials-heading{
    text-align:center;
    margin-bottom:28px;
}

.materials-heading h1{
    font-size:46px;
    line-height:1.18;
    color:var(--tyt-purple-dark);
    margin:0 0 12px;
    font-weight:800;
    letter-spacing:-0.8px;
    max-width:920px;
    margin-inline:auto;
}

.materials-heading p{
    color:var(--tyt-subtext);
    font-size:15px;
    margin:0;
    line-height:1.8;
}

.controls-box{
    background:
        radial-gradient(circle at top right, rgba(244,194,31,0.12), transparent 24%),
        radial-gradient(circle at bottom left, rgba(91,23,214,0.12), transparent 26%),
        linear-gradient(145deg,#ffffff 0%, #f6f0ff 100%);
    border:1px solid rgba(91,23,214,0.08);
    border-radius:30px;
    padding:28px;
    box-shadow:0 18px 38px rgba(63,24,132,0.08);
}

.dropdown-wrap{
    margin-bottom:22px;
}

.dropdown-wrap label{
    display:block;
    font-size:14px;
    font-weight:700;
    color:#3a3254;
    margin-bottom:10px;
}

.dropdown-wrap select{
    width:100%;
    padding:15px 16px;
    border:1px solid #e2d9f4;
    border-radius:16px;
    background:#fff;
    font-size:15px;
    font-family:'Poppins',sans-serif;
    outline:none;
    color:var(--tyt-text);
    box-shadow:0 8px 18px rgba(91,23,214,0.03);
}

.dropdown-wrap select:focus{
    border-color:rgba(91,23,214,0.34);
    box-shadow:0 0 0 4px rgba(91,23,214,0.08);
}

.material-tabs{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
}

.tab-btn{
    border:none;
    background:#fff;
    color:#433d55;
    padding:13px 18px;
    border-radius:16px;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    border:1px solid #e5def5;
    transition:0.25s ease;
    font-family:'Poppins',sans-serif;
    box-shadow:0 6px 16px rgba(0,0,0,0.03);
}

.tab-btn.active{
    background:linear-gradient(135deg,var(--tyt-purple),#7b39f2);
    color:#fff;
    border-color:transparent;
    box-shadow:0 14px 24px rgba(91,23,214,0.24);
}

.tab-btn:hover{
    transform:translateY(-1px);
}

/* COMMON SECTION */
.section{
    padding:54px 8% 74px;
}

.section-head{
    text-align:center;
    margin-bottom:34px;
}

.section-head h2{
    font-size:36px;
    color:var(--tyt-purple-dark);
    margin:0 0 8px;
    font-weight:800;
}

.section-head p{
    color:#6f6a82;
    font-size:15px;
    margin:0;
    line-height:1.8;
}

/* LIST */
.material-list{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
    gap:24px;
}

.material-item{
    background:#fff;
    border:1px solid var(--tyt-border);
    border-radius:26px;
    padding:24px;
    box-shadow:var(--tyt-card-shadow);
    display:flex;
    flex-direction:column;
    gap:14px;
    transition:0.25s ease;
}

.material-item:hover{
    transform:translateY(-4px);
    box-shadow:0 20px 34px rgba(63,24,132,0.11);
}

.material-item-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.material-icon-box{
    width:56px;
    height:56px;
    border-radius:18px;
    background:linear-gradient(135deg,#f4e7ff,#fff5cc);
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.material-icon-box i{
    width:25px;
    height:25px;
    color:var(--tyt-purple);
}

.material-tag{
    background:linear-gradient(135deg,#fff3bf,#ffe070);
    color:#855f00;
    padding:7px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

.material-item h3{
    margin:0;
    font-size:21px;
    color:var(--tyt-purple-dark);
    font-weight:700;
}

.material-item p{
    margin:0;
    color:#6b667d;
    font-size:14px;
    line-height:1.8;
}

.material-meta{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.material-meta span{
    background:#f7f3ff;
    color:#4c4461;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    border:1px solid #ede6fb;
}

.material-item-actions{
    display:flex;
    gap:10px;
    margin-top:auto;
}

.material-item-actions button{
    flex:1;
    border:none;
    background:linear-gradient(135deg,var(--tyt-purple),#7c3cff);
    color:#fff;
    padding:12px 16px;
    border-radius:14px;
    font-weight:700;
    cursor:pointer;
    transition:0.25s ease;
    font-family:'Poppins',sans-serif;
    box-shadow:0 10px 18px rgba(91,23,214,0.16);
}

.material-item-actions button:hover{
    transform:translateY(-1px);
}

.material-item-actions .secondary-btn-item{
    background:#fff;
    color:#433d55;
    border:1px solid #d7ccea;
    box-shadow:none;
}

.material-item-actions .secondary-btn-item:hover{
    border-color:var(--tyt-purple);
    color:var(--tyt-purple);
    background:#faf7ff;
}

/* EMPTY STATE SUPPORT */
.material-list:empty::after{
    content:"No materials available right now.";
    display:block;
    grid-column:1 / -1;
    text-align:center;
    background:#fff;
    border:1px solid var(--tyt-border);
    border-radius:24px;
    padding:28px;
    color:#6f6a82;
    box-shadow:var(--tyt-card-shadow);
}

/* FOOTER */
footer{
    background:#12092a;
    color:#cfc7e7;
    text-align:center;
    padding:22px 20px;
    margin-top:50px;
}

/* BOTTOM NAV */
.bottom-nav{
    display:none;
}

.bottom-item{
    text-decoration:none;
}

/* MOBILE */
@media (max-width:768px){

    .desktop-nav{
        display:none;
    }

    .hamburger{
        display:flex;
    }

    .search-icon{
        display:flex;
    }

    .desktop-search{
        display:none;
    }

    .nav-center{
        display:flex;
        position:fixed;
        top:82px;
        left:-100%;
        width:50%;
        height:calc(100vh - 82px);
        background:white;
        flex-direction:column;
        justify-content:flex-start;
        align-items:flex-start;
        gap:10px;
        padding:20px 15px;
        border-top-right-radius:25px;
        border-bottom-right-radius:25px;
        box-shadow:2px 0 20px rgba(0,0,0,0.1);
        transition:0.3s ease;
        z-index:5000;
        overflow-y:auto;
        -webkit-overflow-scrolling:touch;
    }

    .nav-center.active{
        left:0;
    }

    .nav-center nav{
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        width:100%;
    }

    .nav-center nav a{
        display:flex;
        align-items:center;
        gap:12px;
        margin:0 0 18px 0;
        font-size:14px;
        color:#777;
        width:100%;
        text-align:left;
        padding:8px 5px;
        border-bottom:1px solid #f2f2f2;
        position:static;
    }

    .nav-center nav a::after{
        display:none;
        content:none;
    }

    #mobileSearch{
        display:none;
        position:absolute;
        top:55px;
        right:0;
        width:180px;
        z-index:6000;
        background:white;
    }

    #mobileSearch.active{
        display:block;
    }

    .materials-top{
        padding:28px 6% 16px;
    }

    .materials-heading h1{
        font-size:31px;
    }

    .controls-box{
        padding:20px;
        border-radius:24px;
    }

    .material-tabs{
        gap:10px;
    }

    .tab-btn{
        width:100%;
    }

    .section{
        padding:42px 6% 70px;
    }

    .material-list{
        grid-template-columns:1fr;
    }

    .bottom-nav{
        position:fixed;
        bottom:0;
        width:100%;
        background:white;
        display:flex;
        justify-content:space-around;
        padding:10px 0;
        box-shadow:0 -2px 10px rgba(0,0,0,0.1);
        z-index:1000;
        border-top:1px solid #eee7fb;
    }

    .bottom-item{
        text-align:center;
        font-size:12px;
        color:#777;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
    }

    .bottom-item i{
        width:22px;
        height:22px;
        color:#6b6383;
        margin-bottom:3px;
    }

    .bottom-item p{
        margin:0;
        color:#6b6383;
        font-size:12px;
    }

    .active-bottom i,
    .active-bottom p{
        color:var(--tyt-purple);
    }

    footer{
        margin-bottom:70px;
    }
}

@media (max-width:480px){
    .navbar{
        padding:15px 5%;
    }

    .logo img{
        height:40px;
    }

    .nav-center{
        width:72%;
    }

    .materials-heading h1{
        font-size:27px;
    }

    .section-head h2{
        font-size:28px;
    }

    .material-item{
        padding:20px;
    }

    .material-item-actions{
        flex-direction:column;
    }
}
/* =========================================================
   TELEGRAM MATERIALS + ACCESS CODES
========================================================= */
.material-item[hidden],
.mat-btn[hidden],
.code-msg[hidden]{
    display:none !important;
}

/* Access code box */
.code-box{
    margin-top:22px;
    padding:18px 20px;
    background:#fff;
    border:1px dashed rgba(91,23,214,0.28);
    border-radius:20px;
    display:grid;
    grid-template-columns:1fr minmax(260px, 420px);
    gap:14px 20px;
    align-items:center;
}

.code-box-text{
    display:flex;
    align-items:center;
    gap:14px;
}

.code-box-text > i,
.code-box-text > svg{
    width:26px;
    height:26px;
    color:var(--tyt-purple);
    flex-shrink:0;
}

.code-box-text strong{
    display:block;
    color:var(--tyt-purple-dark);
    font-size:16px;
}

.code-box-text span{
    color:var(--tyt-subtext);
    font-size:13px;
    line-height:1.6;
}

.code-box-input{
    display:flex;
    gap:10px;
}

.code-box-input input{
    flex:1;
    min-width:0;
    padding:13px 15px;
    border:1px solid #e2d9f4;
    border-radius:14px;
    font-family:Consolas, 'Courier New', monospace;
    font-size:15px;
    letter-spacing:0.5px;
    text-transform:uppercase;
    outline:none;
}

.code-box-input input:focus{
    border-color:rgba(91,23,214,0.4);
    box-shadow:0 0 0 4px rgba(91,23,214,0.08);
}

.code-box-input button{
    border:none;
    background:linear-gradient(135deg,var(--tyt-purple),#7c3cff);
    color:#fff;
    padding:0 22px;
    border-radius:14px;
    font-weight:700;
    font-family:'Poppins',sans-serif;
    cursor:pointer;
}

.code-box-input button:disabled{
    opacity:0.6;
    cursor:wait;
}

.code-msg{
    grid-column:1 / -1;
    margin:0;
    padding:10px 14px;
    border-radius:12px;
    font-size:13px;
    line-height:1.6;
    background:#f7f3ff;
    color:#4c4461;
}

.code-msg.is-success{ background:#e9f9ee; color:#166534; }
.code-msg.is-error{ background:#fdecec; color:#b42318; }
.code-msg a{ color:inherit; font-weight:700; }

/* Price + pass */
.material-price{
    display:flex;
    align-items:baseline;
    gap:10px;
}

.material-price strong{
    font-size:24px;
    color:var(--tyt-text);
    font-weight:800;
}

.material-price s{
    color:#9b95ad;
    font-size:15px;
}

.price-free{
    background:#e9f9ee;
    color:#166534;
    padding:6px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
}

.material-pass{
    display:inline-flex;
    align-items:center;
    gap:8px;
    align-self:flex-start;
    background:#f7f3ff;
    color:var(--tyt-purple);
    border:1px solid #ede6fb;
    padding:7px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    text-decoration:none;
}

.material-pass svg{ width:14px; height:14px; }

/* Buttons (links and buttons look the same) */
.material-item-actions{
    flex-wrap:wrap;
}

.material-item-actions .mat-btn{
    flex:1 1 140px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:none;
    background:linear-gradient(135deg,var(--tyt-purple),#7c3cff);
    color:#fff;
    padding:12px 16px;
    border-radius:14px;
    font-weight:700;
    font-size:14px;
    cursor:pointer;
    text-decoration:none;
    font-family:'Poppins',sans-serif;
    box-shadow:0 10px 18px rgba(91,23,214,0.16);
    transition:0.25s ease;
}

.material-item-actions .mat-btn:hover{ transform:translateY(-1px); }
.material-item-actions .mat-btn svg{ width:17px; height:17px; }

.material-item-actions .mat-open{
    background:linear-gradient(135deg,#229ed9,#1b86c4);
    box-shadow:0 10px 18px rgba(34,158,217,0.22);
}

.material-item-actions .mat-secondary{
    background:#fff;
    color:#433d55;
    border:1px solid #d7ccea;
    box-shadow:none;
}

.material-item-actions .mat-secondary:hover{
    border-color:var(--tyt-purple);
    color:var(--tyt-purple);
    background:#faf7ff;
}

.material-unlocked{
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:#e9f9ee;
    color:#166534;
    padding:7px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    margin-left:auto;
}

.material-unlocked svg{ width:14px; height:14px; }

.material-item.just-unlocked{
    box-shadow:0 0 0 3px rgba(34,197,94,0.45), var(--tyt-card-shadow);
}

@media (max-width:768px){
    .code-box{
        grid-template-columns:1fr;
        padding:16px;
    }
}

@media (max-width:480px){
    .code-box-input{
        flex-direction:column;
    }

    .code-box-input button{
        padding:13px 22px;
    }
}

/* =========================================================
   MATERIALS BY EMAIL (Generate Token) — assets/js/materials.js
========================================================= */
.mail-steps{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-top:16px;
}

.mail-step{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px 14px;
    background:#fff;
    border:1px solid var(--tyt-border,#ece7f7);
    border-radius:16px;
}

.mail-step > span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:26px;
    height:26px;
    flex-shrink:0;
    border-radius:50%;
    background:linear-gradient(135deg,#5b17d6,#8b4dff);
    color:#fff;
    font-size:13px;
    font-weight:700;
}

.mail-step strong{
    display:block;
    font-size:14px;
    color:#1f1f2e;
}

.mail-step small{
    display:block;
    font-size:12px;
    line-height:1.45;
    color:#6b6680;
}

.mail-step a{ color:#5b17d6; font-weight:600; word-break:break-all; }

.mat-token[disabled]{ opacity:1; cursor:default; }

.material-item.has-token .mat-token{
    background:#f3edff;
    color:#5b17d6;
    box-shadow:none;
}

.material-item.is-sent .mat-token{
    background:#e8f8ee;
    color:#15803d;
}

.mat-token-panel{
    margin-top:12px;
    padding:12px;
    border:1px dashed #d8c8ff;
    border-radius:14px;
    background:#fbf9ff;
    font-size:13px;
    color:#3f3952;
}

.mat-token-panel[hidden]{ display:none; }

.mat-token-row{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
}

.mat-token-label{
    font-size:12px;
    color:#6b6680;
}

.mat-token-code{
    font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
    font-size:15px;
    font-weight:700;
    letter-spacing:0.5px;
    color:#2f0f73;
    background:#fff;
    border:1px solid #e2d6ff;
    border-radius:8px;
    padding:4px 10px;
    user-select:all;
}

.mat-token-copy{
    border:1px solid #d8c8ff;
    background:#fff;
    color:#5b17d6;
    font:inherit;
    font-size:12px;
    font-weight:600;
    padding:5px 12px;
    border-radius:999px;
    cursor:pointer;
}

.mat-token-copy:hover{ background:#f3edff; }

.mat-token-steps{
    margin:10px 0 10px 18px;
    padding:0;
    line-height:1.55;
}

.mat-token-steps li{ margin-bottom:3px; }
.mat-token-steps a{ color:#5b17d6; font-weight:600; word-break:break-all; }

.mat-token-mail{
    display:inline-flex;
    width:100%;
    justify-content:center;
}

.mat-token-note{
    margin:8px 0 0;
    font-size:11px;
    color:#8a83a0;
}

.mat-token-done{
    margin:0;
    color:#15803d;
    font-weight:500;
}

@media (max-width:768px){
    .mail-steps{ grid-template-columns:1fr; }
}
