/*
 * Savanna & Sage Institute - Admin Portal Styles
 * Color Scheme from Logo
 */

:root {
    --primary-blue: #1976D2;
    --primary-red: #E53935;
    --dark-bg: #2C2C2C;
    --light-blue: #42A5F5;
    --light-red: #EF5350;
    --success-green: #4CAF50;
    --warning-orange: #FF9800;
    --white: #FFFFFF;
    --light-grey: #F5F7FA;
    --border-grey: #E1E8ED;
    --text-dark: #2C2C2C;
    --text-grey: #666666;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-grey);
    color: var(--text-dark);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-red) 100%);
    color: var(--white);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .logo-section h1 {
    font-size: 24px;
    font-weight: 600;
}

.header .logo-section .institute-name {
    font-size: 14px;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-actions a, .header-actions span {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
}

.header-actions a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.btn:hover {
    background: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-primary {
    background: var(--primary-blue);
}

.btn-danger {
    background: var(--primary-red);
}

.btn-danger:hover {
    background: var(--light-red);
}

.btn-success {
    background: var(--success-green);
}

.btn-success:hover {
    background: #66BB6A;
}

.btn-warning {
    background: var(--warning-orange);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-blue);
    transition: all 0.3s;
}

.stat-card:nth-child(2n) {
    border-left-color: var(--primary-red);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: var(--text-grey);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .number {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
}

/* Sections */
.section {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section h2 {
    margin-bottom: 20px;
    color: var(--text-dark);
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 10px;
    font-size: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
}

table th {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

table td {
    padding: 15px;
    border-top: 1px solid var(--border-grey);
}

table tr:hover {
    background: var(--light-grey);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-student {
    background: #E3F2FD;
    color: var(--primary-blue);
}

.badge-lecturer {
    background: #F3E5F5;
    color: #7B1FA2;
}

.badge-admin {
    background: #FFF3E0;
    color: #E65100;
}

.badge-active {
    background: #E8F5E9;
    color: var(--success-green);
}

.badge-inactive {
    background: #FFEBEE;
    color: var(--primary-red);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left-color: var(--success-green);
}

.alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border-left-color: var(--primary-red);
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border-left-color: var(--warning-orange);
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-action {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.quick-action:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: var(--primary-blue);
}

.quick-action a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 15px;
}

/* Filters */
.filters {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filters input,
.filters select {
    padding: 10px 15px;
    border: 2px solid var(--border-grey);
    border-radius: 5px;
    font-size: 14px;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Login Page Specific */
.login-container {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 50px 40px;
    width: 100%;
    max-width: 450px;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-container .logo h1 {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    margin-bottom: 5px;
}

.login-container .logo p {
    color: var(--text-grey);
    font-size: 14px;
}

.divider {
    margin: 25px 0;
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-grey);
}

.divider span {
    background: var(--white);
    padding: 0 15px;
    position: relative;
    color: var(--text-grey);
    font-size: 13px;
}

.footer-links {
    text-align: center;
    margin-top: 25px;
}

.footer-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

/* ============================================================================
   MOBILE RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet and Below (768px) */
@media screen and (max-width: 768px) {
    /* Header */
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header .logo-section h1 {
        font-size: 20px;
    }

    .header .logo-section .institute-name {
        font-size: 12px;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .header-actions a, .header-actions span {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Container */
    .container {
        padding: 20px 15px;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-card {
        padding: 20px 15px;
    }

    .stat-card .number {
        font-size: 24px;
    }

    .stat-card h3 {
        font-size: 12px;
    }

    /* Quick Actions */
    .quick-actions {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .quick-action {
        padding: 15px 10px;
    }

    .quick-action a {
        font-size: 13px;
    }

    /* Sections */
    .section {
        padding: 20px 15px;
    }

    .section h2 {
        font-size: 18px;
    }

    /* Tables - Make them scrollable */
    .section table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th, table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    /* Buttons */
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 10px 12px;
    }

    /* Login Container */
    .login-container {
        padding: 30px 25px;
        margin: 20px;
    }

    .login-container .logo h1 {
        font-size: 24px;
    }

    /* Flex utilities */
    .flex-between {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .flex {
        flex-wrap: wrap;
    }

    /* Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters input,
    .filters select {
        width: 100%;
    }
}

/* Mobile (480px and below) */
@media screen and (max-width: 480px) {
    /* Header */
    .header {
        padding: 12px 15px;
    }

    .header .logo-section h1 {
        font-size: 18px;
    }

    .header .logo-section .institute-name {
        font-size: 11px;
    }

    .header-actions a, .header-actions span {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Container */
    .container {
        padding: 15px 10px;
    }

    /* Stats Grid - Stack on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px 15px;
    }

    .stat-card .number {
        font-size: 28px;
    }

    /* Quick Actions - 2 columns on mobile */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-action {
        padding: 12px 8px;
    }

    .quick-action a {
        font-size: 12px;
    }

    /* Sections */
    .section {
        padding: 15px 12px;
    }

    .section h2 {
        font-size: 16px;
        padding-bottom: 8px;
    }

    /* Tables */
    table th, table td {
        padding: 8px 6px;
        font-size: 11px;
    }

    /* Buttons - Full width on mobile for better tap targets */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .section .btn {
        width: 100%;
        margin-bottom: 8px;
        text-align: center;
    }

    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 12px;
    }

    /* Login Container */
    .login-container {
        padding: 25px 20px;
        margin: 15px;
    }

    .login-container .logo h1 {
        font-size: 20px;
    }

    .login-container .logo p {
        font-size: 12px;
    }

    /* Badges */
    .badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* Landscape mobile orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 10px 15px;
    }

    .header .logo-section h1 {
        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .stat-card {
        padding: 15px 12px;
    }

    .stat-card .number {
        font-size: 20px;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .header-actions a, .header-actions span {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    table tr {
        cursor: pointer;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .stat-card:hover,
    .quick-action:hover {
        transform: none;
    }

    /* Add active state instead */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}
