/*=========================================================
    KOZI WORD SEARCH
    Version 0.1

    style.css

    Responsible for:
    - Global Styles
    - Layout
    - Header
    - Grid Area
    - Sidebar
    - Buttons
    - Message Panel
=========================================================*/


/*=========================================================
    GOOGLE FONT
=========================================================*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');


/*=========================================================
    CSS VARIABLES
=========================================================*/

:root{

    --primary:#1E88E5;
    --primary-dark:#1565C0;

    --success:#2E7D32;
    --danger:#D32F2F;

    --background:#F4F7FB;

    --white:#FFFFFF;

    --text:#263238;

    --text-light:#607D8B;

    --border:#DCE3EA;

    --shadow:0 8px 25px rgba(0,0,0,.08);

    --radius:14px;

}


/*=========================================================
    RESET
=========================================================*/

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}


body{

    font-family:'Poppins',sans-serif;

    background:var(--background);

    color:var(--text);

    min-height:100vh;

}


/*=========================================================
    MAIN GAME
=========================================================*/

#game{

    width:min(1400px,95%);

    margin:40px auto;

}


/*=========================================================
    HEADER
=========================================================*/

.header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:30px;

}


.logo h1{

    font-size:2.2rem;

    font-weight:800;

    color:var(--primary);

}


.logo p{

    margin-top:6px;

    color:var(--text-light);

}


/*=========================================================
    BUTTONS
=========================================================*/

.btn{

    border:none;

    outline:none;

    cursor:pointer;

    background:var(--primary);

    color:#fff;

    padding:14px 28px;

    border-radius:12px;

    font-size:1rem;

    font-weight:600;

    transition:.25s;

}


.btn:hover{

    background:var(--primary-dark);

    transform:translateY(-2px);

}


.secondary{

    background:#455A64;

}


.secondary:hover{

    background:#37474F;

}


/*=========================================================
    GAME LAYOUT
=========================================================*/

.game-area{

    display:grid;

    grid-template-columns:3fr 1fr;

    gap:25px;

}


/*=========================================================
    GRID PANEL
=========================================================*/

.grid-panel{

    background:var(--white);

    border-radius:var(--radius);

    box-shadow:var(--shadow);

    padding:25px;

}


/*=========================================================
    LETTER GRID
=========================================================*/

.grid{

    display:grid;

    grid-template-columns:repeat(10,1fr);

    gap:6px;

}


/*=========================================================
    LETTER CELL
=========================================================*/

.cell{

    aspect-ratio:1;

    background:#F8FAFC;

    border:1px solid var(--border);

    border-radius:8px;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:1.2rem;

    font-weight:700;

    cursor:pointer;

    user-select:none;

    transition:.2s;

}


.cell:hover{

    background:#E3F2FD;

    transform:scale(1.05);

}


.cell.selected{

    background:#90CAF9;

    color:#fff;

}


.cell.found{

    background:var(--success);

    color:#fff;

}


/*=========================================================
    SIDEBAR
=========================================================*/

.sidebar{

    display:flex;

    flex-direction:column;

    gap:20px;

}


.card{

    background:var(--white);

    border-radius:var(--radius);

    box-shadow:var(--shadow);

    padding:22px;

}


.card h2{

    margin-bottom:15px;

    font-size:1.2rem;

}


#wordList{

    list-style:none;

}


#wordList li{

    padding:10px 0;

    border-bottom:1px solid var(--border);

    font-weight:500;

}


#wordList li:last-child{

    border-bottom:none;

}


#wordList li.found{

    color:var(--success);

    text-decoration:line-through;

    font-weight:700;

}


/*=========================================================
    STATS
=========================================================*/

.stats p{

    font-size:1rem;

    font-weight:600;

}


/*=========================================================
    MESSAGE PANEL
=========================================================*/

.message{

    margin-top:35px;

    background:var(--white);

    box-shadow:var(--shadow);

    border-radius:var(--radius);

    padding:35px;

    text-align:center;

}


.message h2{

    color:var(--success);

    margin-bottom:15px;

}


.message p{

    margin-bottom:20px;

}


/*=========================================================
    LOADING SCREEN
=========================================================*/

#loading-screen{

    position:fixed;

    inset:0;

    background:#fff;

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    z-index:9999;

}


.loader{

    width:60px;

    height:60px;

    border:6px solid #ddd;

    border-top-color:var(--primary);

    border-radius:50%;

    animation:spin 1s linear infinite;

    margin-bottom:20px;

}


@keyframes spin{

    from{

        transform:rotate(0deg);

    }

    to{

        transform:rotate(360deg);

    }

}


/*=========================================================
    UTILITY CLASSES
=========================================================*/

.hidden{

    display:none;

}

/*=========================================
CATEGORY SCREEN
=========================================*/

.category-screen{

    max-width:900px;

    margin:40px auto;

}

.category-list{

    width:100%;
    max-width:900px;
    margin:30px auto;

}

.category-card{

    display:flex;
    justify-content:space-between;
    align-items:center;

    gap:20px;

    padding:20px 25px;

    margin-bottom:18px;

    background:#fff;

    border:2px solid #e5e5e5;

    border-radius:18px;

    cursor:pointer;

    transition:all .30s ease;

    box-shadow:0 6px 18px rgba(0,0,0,.08);

}

.category-card:hover{

    transform:translateY(-4px);

    box-shadow:0 14px 28px rgba(0,0,0,.15);

    border-color:var(--primary);

}

.category-card.active{

    border-color:var(--primary);

    background:#f7fffa;

}

/*=========================================================
    LEFT SIDE
=========================================================*/

.category-left{

    display:flex;

    align-items:center;

    gap:18px;

    flex:1;

}

.category-icon{

    width:65px;

    height:65px;

    border-radius:50%;

    display:flex;

    justify-content:center;

    align-items:center;

    flex-shrink:0;

    color:#fff;

    font-size:26px;

}

.category-text{

    flex:1;

}

.category-name{

    font-size:1.35rem;

    font-weight:700;

    margin-bottom:5px;

}

.category-description{

    color:#666;

    font-size:.95rem;

    line-height:1.5;

}

/*=========================================================
    RIGHT SIDE
=========================================================*/

.category-right{

    display:flex;

    flex-direction:column;

    align-items:flex-end;

    justify-content:center;

    min-width:120px;

}

.category-count{

    font-weight:700;

    color:var(--primary);

    margin-bottom:8px;

}

.difficulty{

    color:#f1c40f;

    font-size:1rem;

    letter-spacing:2px;

}

#game-screen{

    display:none;

}

.category-card{

    animation:fadeIn .5s ease;

}

@keyframes fadeIn{

    from{

        opacity:0;

        transform:translateY(20px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}
/*=========================================================
    CATEGORY SCREEN
=========================================================*/

.category-screen{

    max-width:900px;

    margin:50px auto;

    text-align:center;

    padding:30px;

}

.welcome{

    margin-bottom:40px;

}

.game-title{

    font-size:3.5rem;

    font-weight:800;

    color:var(--primary);

    margin-bottom:10px;

    letter-spacing:2px;

    text-transform:uppercase;

}

.game-subtitle{

    font-size:1.1rem;

    color:#666;

}

.category-heading{

    margin-bottom:25px;

    font-size:2rem;

}

/*=========================================================
    PRIMARY BUTTON
=========================================================*/

.primary-btn{

    display:inline-block;

    margin-top:35px;

    padding:16px 40px;

    border:none;

    border-radius:12px;

    background:var(--primary);

    color:#fff;

    font-size:1.1rem;

    font-weight:700;

    cursor:pointer;

    transition:all .25s ease;

    box-shadow:0 8px 20px rgba(0,0,0,.15);

}

.primary-btn:hover{

    transform:translateY(-3px);

    background:var(--primary-dark);

}

.primary-btn:active{

    transform:translateY(0);

}

.category-card{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:20px 25px;

    border:2px solid #ddd;

    border-radius:15px;

    background:#fff;

    cursor:pointer;

    transition:.25s;

    margin-bottom:15px;

    box-shadow:0 3px 10px rgba(0,0,0,.05);

}

.category-card:hover{

    transform:translateY(-3px);

    border-color:var(--primary);

    box-shadow:0 10px 25px rgba(0,0,0,.10);

}

.category-card.active{

    background:var(--primary);

    color:#fff;

    border-color:var(--primary);

}

/*=========================================================
    RESULT MODAL
=========================================================*/

.modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.65);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:9999;

}

.modal.hidden{

    display:none;

}

.modal-content{

    width:90%;

    max-width:500px;

    background:#fff;

    border-radius:18px;

    overflow:hidden;

    animation:popup .35s ease;

}

.modal-header{

    background:var(--primary);

    color:#fff;

    padding:20px;

    text-align:center;

}

.modal-body{

    padding:25px;

    line-height:2;

}

.modal-footer{

    padding:20px;

    display:flex;

    justify-content:center;

    gap:15px;

}

@keyframes popup{

    from{

        transform:scale(.8);

        opacity:0;

    }

    to{

        transform:scale(1);

        opacity:1;

    }

}

/*=========================================================
    HOW TO PLAY
=========================================================*/

.instructions{

    margin:30px auto;

    max-width:900px;

    background:#ffffff;

    border-radius:15px;

    padding:25px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

}

.instructions h2{

    text-align:center;

    color:var(--primary);

    margin-bottom:20px;

}

.instructions ul{

    margin-bottom:20px;

    padding-left:20px;

    line-height:1.9;

}

.direction-grid{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:12px;

    margin:20px 0;

}

.direction-grid div{

    background:#f7f7f7;

    padding:12px;

    border-radius:10px;

    text-align:center;

    font-weight:600;

    transition:.3s;

}

.direction-grid div:hover{

    background:var(--primary);

    color:#fff;

    transform:translateY(-3px);

}

.tip{

    text-align:center;

    font-weight:600;

    color:#555;

    margin-top:15px;

}

.home-header{

    text-align:center;

    margin:25px auto 40px;

}

.game-logo{

    width:180px;

    max-width:80%;

    display:block;

    margin:0 auto 15px;

}

.home-header h1{

    font-size:2.8rem;

    margin:10px 0;

    color:var(--primary);

}

.tagline{

    color:#666;

    font-size:1.1rem;

}

.logo{

    display:flex;

    align-items:center;

    gap:18px;

}

.game-logo-small{

    width:70px;

    height:auto;

    flex-shrink:0;

}