/* ======================================================
   KT DYNAMIC CMS - MASTER ADMIN STYLESHEET
   Description: Controls Login, Dashboard, Forms & Tables
========================================================= */

/* --- 1. Global Reset & Typography --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}
body { 
    display: flex; 
    background: #f4f7f6; 
    min-height: 100vh; 
    color: #333;
}
a { text-decoration: none; }

/* --- 2. Login Page Specific Styles --- */
body.login-body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    background: #0A1C3A; 
    padding: 20px; 
}
.login-box { 
    background: white; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    width: 100%; 
    max-width: 380px; 
}
.login-box h2 { 
    text-align: center; 
    color: #0A1C3A; 
    margin-bottom: 25px; 
    font-size: 1.8rem;
}
.login-box input[type="text"], 
.login-box input[type="password"] { 
    width: 100%; 
    padding: 12px 15px; 
    margin: 10px 0 15px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-size: 1rem; 
}
.login-box button { 
    width: 100%; 
    padding: 12px; 
    background: #FFC107; 
    border: none; 
    color: #0A1C3A; 
    font-weight: bold; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 1.1rem; 
    margin-top: 10px; 
    transition: background 0.3s ease;
}
.login-box button:hover { 
    background: #e5a900; 
}
.login-box .error { 
    color: #d9534f; 
    text-align: center; 
    font-size: 0.9rem; 
    margin-bottom: 15px; 
    font-weight: bold; 
    background: #fdf2f2; 
    padding: 10px; 
    border-radius: 4px; 
    border: 1px solid #f5c6c6; 
}
/* Back to Website Link Style */
.back-link { 
    display: block; 
    text-align: center; 
    margin-top: 25px; 
    color: #666; 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: bold; 
    transition: color 0.3s ease;
}
.back-link:hover { 
    color: #0A1C3A; 
}

/* --- 3. Sidebar & Navigation --- */
.sidebar { 
    width: 260px; 
    background: #0A1C3A; 
    height: 100vh; 
    color: white; 
    padding: 20px; 
    position: fixed; 
    z-index: 100; 
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}
.sidebar h2 { 
    text-align: center; 
    margin-bottom: 30px; 
    font-size: 1.4rem; 
}
.sidebar h2 a { 
    color: #FFC107; 
}
.mobile-menu-btn { 
    display: none; /* Hidden on PC */
} 
.sidebar-links { 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
}
.sidebar-links a { 
    display: block; 
    color: #a0aec0; 
    padding: 12px 15px; 
    margin-bottom: 8px; 
    border-radius: 4px; 
    font-weight: 600; 
    transition: all 0.2s ease;
}
.sidebar-links a:hover, 
.sidebar-links a.active { 
    background: #122B55; 
    color: white; 
    padding-left: 20px; /* Slight indent effect on hover/active */
}
.logout { 
    background: #d9534f !important; 
    color: white !important; 
    margin-top: 30px; 
    text-align: center; 
}
.logout:hover {
    background: #c9302c !important;
}

/* --- 4. Main Content & Dashboard Cards --- */
.main-content { 
    margin-left: 260px; 
    padding: 40px; 
    width: calc(100% - 260px); 
}
.header { 
    border-bottom: 2px solid #ddd; 
    padding-bottom: 15px; 
    margin-bottom: 30px; 
}
.header h1 { 
    color: #0A1C3A; 
    margin-bottom: 5px; 
}
.header p {
    color: #666;
}

/* Grid Layout for Dashboard Cards */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 20px; 
    margin-top: 20px; 
}
.card-link { color: inherit; }
.card { 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    border-left: 5px solid #0A1C3A; 
    transition: all 0.3s ease; 
}
.card-link:hover .card { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); 
}
.card h3 { 
    color: #666; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    margin-bottom: 10px; 
}
.card p { 
    font-size: 2.2rem; 
    font-weight: bold; 
    color: #0A1C3A; 
}

/* --- 5. Forms & Inputs --- */
.form-box { 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    margin-bottom: 40px; 
    max-width: 800px; 
}
.form-box label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: #0A1C3A; 
}
.form-box input[type="text"], 
.form-box select, 
.form-box textarea, 
.form-box input[type="file"] { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 20px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-size: 1rem; 
    background: #fdfdfd;
}
.form-box input:focus, 
.form-box select:focus, 
.form-box textarea:focus {
    border-color: #0A1C3A;
    outline: none;
}
.form-box button { 
    padding: 12px 25px; 
    background: #0A1C3A; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: bold; 
    transition: 0.3s;
}
.form-box button:hover { 
    background: #FFC107; 
    color: #0A1C3A; 
}

/* --- 6. Tables & Lists --- */
h2 { color: #0A1C3A; margin-bottom: 15px;}
.table-responsive {
    overflow-x: auto;
}
table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-radius: 8px; 
    overflow: hidden; 
}
th, td { 
    padding: 15px; 
    text-align: left; 
    border-bottom: 1px solid #eee; 
}
th { 
    background-color: #0A1C3A; 
    color: white; 
    font-weight: 600;
}
tr:hover {
    background-color: #f9f9f9;
}
img.preview { 
    width: 80px; 
    height: 50px; 
    object-fit: cover; 
    border-radius: 4px; 
    border: 1px solid #ddd;
}

/* --- 7. Buttons & Badges --- */
.badge { 
    background: #0275d8; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 4px; 
    font-size: 0.85rem; 
    font-weight: bold; 
}
.btn-edit { 
    color: white; 
    background: #0275d8; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-size: 0.85rem; 
    margin-right: 5px; 
    display: inline-block; 
}
.btn-edit:hover { background: #025aa5; }

.btn-delete { 
    color: white; 
    background: #d9534f; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-size: 0.85rem; 
    display: inline-block; 
}
.btn-delete:hover { background: #c9302c; }

/* ======================================================
   8. MOBILE RESPONSIVE (Media Queries)
========================================================= */
@media screen and (max-width: 768px) {
    body { flex-direction: column; }
    
    /* Adjust Sidebar for Mobile */
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        padding: 15px 20px; 
    }
    .sidebar h2 { margin-bottom: 15px; text-align: left; }
    
    /* Hamburger Button */
    .mobile-menu-btn { 
        display: block; 
        background: #FFC107; 
        color: #0A1C3A; 
        padding: 12px; 
        text-align: center; 
        font-weight: bold; 
        border-radius: 4px; 
        cursor: pointer; 
        margin-bottom: 10px; 
    }
    
    /* Toggle Menu */
    .sidebar-links { display: none; }
    .sidebar-links.active { display: flex; }
    
    .sidebar-links a { text-align: center; padding: 15px; }
    
    /* Adjust Main Content */
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 20px 15px; 
    }
    
    /* Adjust Tables */
    table { 
        display: block; 
        width: 100%; 
        overflow-x: auto; /* Makes table scrollable sideways */
        white-space: nowrap; 
    }
}