/* school-attendance-sheet-generator.css */

:root {
    /* Vibrant Color Scheme */
    --primary-blue: #3498db;
    --primary-dark: #2c3e50;
    --accent-green: #2ecc71;
    --accent-coral: #ff7e5f;
    --accent-purple: #9b59b6;
    --accent-emerald: #2ecc71;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3498db, #2c3e50);
    --gradient-success: linear-gradient(135deg, #2ecc71, #27ae60);
    --gradient-warning: linear-gradient(135deg, #ff7e5f, #feb47b);
    --gradient-danger: linear-gradient(135deg, #e74c3c, #c0392b);
    --gradient-purple: linear-gradient(135deg, #9b59b6, #8e44ad);
    
    /* Light Theme */
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-color: #2c3e50;
    --border-color: rgba(52, 152, 219, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
}

.dark-mode {
    --bg-color: #1a1a2e;
    --card-bg: rgba(30, 30, 46, 0.9);
    --text-color: #ecf0f1;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s, transform 0.2s, box-shadow 0.2s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-color) 0%, #e3f2fd 100%);
}

.dark-mode body {
    background: linear-gradient(135deg, var(--bg-color) 0%, #16213e 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.dashboard-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    animation: slideDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid;
    border-image: var(--gradient-primary) 1;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: transform 0.3s ease;
}

.logo-preview:hover {
    transform: scale(1.05);
}

.logo-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-text h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 5px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.1rem;
}

/* AI Banner */
.ai-banner {
    background: var(--gradient-purple);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    animation: pulse 2s infinite;
}

.ai-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ai-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.ai-text {
    flex: 1;
    font-size: 1.1rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.card-gradient-1 { background: var(--gradient-primary); color: white; }
.card-gradient-2 { background: var(--gradient-success); color: white; }
.card-gradient-3 { background: var(--gradient-danger); color: white; }
.card-gradient-4 { background: var(--gradient-warning); color: white; }

.card-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50% 50% 0 0;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.card .value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.card .label {
    opacity: 0.8;
    font-size: 1rem;
}

/* Analytics Section */
.analytics-section {
    margin-bottom: 40px;
}

.analytics-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.analytics-card h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.4rem;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Controls Section */
.controls-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.student-add-section {
    display: flex;
    justify-content: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Form Elements */
.select-glass, .input-glass, .search-input {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 15px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.select-glass:focus, .input-glass:focus, .search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-with-button {
    display: flex;
    gap: 10px;
}

/* Buttons */
button {
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-gradient {
    background: var(--gradient-primary);
    color: white;
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-ai {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Search Section */
.search-container {
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.7;
}

.search-input {
    width: 100%;
    padding-left: 45px;
}

/* Table Section */
.table-section {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.table-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h3 {
    color: var(--text-color);
    font-size: 1.4rem;
}

.table-container {
    overflow-x: auto;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
}

.attendance-table th, .attendance-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.attendance-table th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.attendance-table tr {
    transition: background-color 0.2s ease;
}

.attendance-table tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.attendance-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.dark-mode .attendance-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Status Classes */
.present {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
    color: var(--accent-green);
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}

.absent {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
    color: var(--accent-coral);
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}

.leave {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.15), rgba(243, 156, 18, 0.05));
    color: var(--accent-purple);
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}

.editable {
    cursor: pointer;
    min-width: 100px;
    transition: all 0.3s ease;
}

.editable:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Action Section */
.action-section {
    margin-bottom: 40px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn-action {
    padding: 15px 20px;
    font-size: 1rem;
    justify-content: center;
}

.btn-save { background: var(--gradient-success); color: white; }
.btn-export { background: var(--gradient-primary); color: white; }
.btn-report { background: var(--gradient-purple); color: white; }
.btn-print { background: var(--glass-bg); color: var(--text-color); border: 1px solid var(--glass-border); }
.btn-clear { background: var(--gradient-danger); color: white; }

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .print-view, .print-view * {
        visibility: visible;
    }
    .print-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .controls-section {
        padding: 15px;
    }
    
    .attendance-table th, .attendance-table td {
        padding: 10px 15px;
    }
}