/**
 * Kerala Kala Academy - Arts Institute Management System
 * Kerala/Indian classical arts inspired theme
 */

:root {
    --color-gold: #c9a227;
    --color-gold-light: #e8d48b;
    --color-maroon: #8b0000;
    --color-maroon-dark: #5c0000;
    --color-cream: #f5f0e6;
    --color-cream-dark: #e8e0d0;
    --color-saffron: #ff9933;
    --color-green: #138808;
    --color-white: #fff;
    --color-text: #2c1810;
    --color-text-muted: #6b5344;
    --font-display: 'Playfair Display', 'Noto Serif Devanagari', Georgia, serif;
    --font-body: 'Lato', 'Noto Sans', system-ui, sans-serif;
    --shadow: 0 4px 20px rgba(44, 24, 16, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-cream);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-maroon-dark);
}

a {
    color: var(--color-maroon);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--color-gold);
}

/* Layout */
.app-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--color-maroon) 0%, var(--color-maroon-dark) 100%);
    color: var(--color-white);
    padding: 0.25rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
}
.site-logo:hover {
    color: var(--color-gold-light);
}
.site-logo svg {
    width: 40px;
    height: 40px;
    fill: var(--color-gold);
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-main a {
    color: rgba(255,255,255,0.95);
    font-weight: 500;
}
.nav-main a:hover {
    color: var(--color-gold-light);
}
.nav-main .user-name {
    color: var(--color-gold-light);
    font-size: 0.9rem;
}
.nav-main .btn {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    background: var(--color-gold);
    color: var(--color-maroon-dark);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.nav-main .btn:hover {
    background: var(--color-gold-light);
    color: var(--color-maroon);
}

/* Main content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
    min-width: 0;
}

/* Hero / Home */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(180deg, rgba(201,162,39,0.15) 0%, transparent 60%);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-maroon);
}
.hero .tagline {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}
.hero .btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}
.btn-primary {
    background: var(--color-maroon);
    color: var(--color-white);
}
.btn-primary:hover {
    background: var(--color-maroon-dark);
    color: var(--color-gold-light);
}
.btn-secondary {
    background: var(--color-gold);
    color: var(--color-maroon-dark);
}
.btn-secondary:hover {
    background: var(--color-gold-light);
}
.btn-outline {
    background: transparent;
    color: var(--color-maroon);
    border: 2px solid var(--color-maroon);
}
.btn-outline:hover {
    background: var(--color-maroon);
    color: var(--color-white);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(44, 24, 16, 0.15);
}
.card-image {
    height: 160px;
    background: linear-gradient(135deg, var(--color-maroon) 0%, var(--color-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 3rem;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-body {
    padding: 1.25rem;
}
.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.card-body p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.card-body .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}
.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--color-cream-dark);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-white);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.2);
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
select.form-control {
    cursor: pointer;
}

.form-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* Tables */
.table-wrap {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}
th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-cream-dark);
}
th {
    background: var(--color-maroon);
    color: var(--color-white);
    font-weight: 600;
}
tr:hover {
    background: rgba(201,162,39,0.06);
}
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #cce5ff; color: #004085; }
.badge-secondary { background: var(--color-cream-dark); color: var(--color-text-muted); }
.badge-error { background: #f8d7da; color: #721c24; }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* Dashboard */
.page-title {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.dash-card {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--color-gold);
}
.dash-card h4 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.dash-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-maroon);
}

/* Footer */
.site-footer {
    background: var(--color-maroon-dark);
    color: rgba(255,255,255,0.85);
    padding: 1.5rem;
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
}
.site-footer a {
    color: var(--color-gold-light);
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }

/* Decorative border (Kerala style) */
.kerala-border {
    border-bottom: 3px solid var(--color-gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Kerala / Indian classical arts accent */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-maroon) 0%, var(--color-gold) 50%, var(--color-maroon) 100%);
    border-radius: var(--radius) var(--radius) 0 0;
}
.hero {
    position: relative;
}

/* Card image placeholder - classical arts motif */
.card-image span {
    font-size: 4rem;
    opacity: 0.9;
}

/* ========== Responsive: tablet and mobile ========== */
@media (max-width: 992px) {
    .main-content {
        padding: 1rem;
    }
    .site-header .inner {
        padding: 0 1rem;
    }
    .nav-main {
        gap: 1rem;
    }
    .page-title {
        font-size: 1.5rem;
    }
    .dash-cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 0.75rem;
    }
    .site-header .inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .site-logo {
        font-size: 1.15rem;
    }
    .site-logo svg {
        width: 32px;
        height: 32px;
    }
    .nav-main {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    .nav-main .user-name {
        width: 100%;
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    .nav-main a {
        font-size: 0.9rem;
    }
    .nav-main .btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
    }
    .main-content {
        padding: 0.75rem 1rem;
    }
    .hero {
        padding: 2rem 0.75rem;
    }
    .hero h1 {
        font-size: 1.75rem;
    }
    .hero .tagline {
        font-size: 1rem;
    }
    .hero .btns {
        flex-direction: column;
    }
    .hero .btns .btn {
        width: 100%;
    }
    .form-card {
        max-width: 100%;
        padding: 1.25rem;
        margin-left: 0;
        margin-right: 0;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .dash-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .dash-card .value {
        font-size: 1.5rem;
    }
    .table-wrap {
        border-radius: var(--radius);
    }
    th, td {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    .card-body {
        padding: 1rem;
    }
    .card-body h3 {
        font-size: 1.1rem;
    }
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    .kerala-border {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .site-header .inner {
        padding: 0.5rem;
    }
    .nav-main .user-name {
        display: none;
    }
    .main-content {
        padding: 0.5rem 0.75rem;
    }
    .page-title {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
    .dash-cards {
        grid-template-columns: 1fr;
    }
    .dash-card {
        padding: 1rem;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn,
    .form-actions a.btn {
        width: 100%;
    }
    table {
        min-width: 320px;
    }
    th, td {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
    .card-body .meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}
