/* Admin Panel Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --ajrak-red: #b32222;
    --ajrak-black: #000000;
    --ajrak-white: #ffffff;
    --ajrak-turquoise: #cce7e8;
    --admin-bg: #f8f9fa;
    --admin-sidebar: #2c3e50;
    --admin-card: #ffffff;
    --admin-border: #e9ecef;
    --admin-text: #495057;
    --admin-success: #28a745;
    --admin-warning: #ffc107;
    --admin-danger: #dc3545;
    --admin-info: #17a2b8;
}

body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ajrak-red), var(--ajrak-black));
}

.login-container {
    background: var(--admin-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid var(--ajrak-red);
}

.login-header h1 {
    color: var(--ajrak-red);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--admin-text);
    font-size: 0.9rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--admin-text);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--ajrak-red);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--ajrak-red);
    color: var(--ajrak-white);
}

.btn-primary:hover {
    background-color: var(--ajrak-black);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--admin-text);
    color: var(--ajrak-white);
}

.btn-secondary:hover {
    background-color: var(--ajrak-black);
}

.btn-success {
    background-color: var(--admin-success);
    color: var(--ajrak-white);
}

.btn-warning {
    background-color: var(--admin-warning);
    color: var(--ajrak-black);
}

.btn-danger {
    background-color: var(--admin-danger);
    color: var(--ajrak-white);
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--admin-sidebar);
    color: var(--ajrak-white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--ajrak-white);
    border-left-color: var(--ajrak-red);
}

.nav-link.active {
    background-color: rgba(179, 34, 34, 0.2);
    color: var(--ajrak-white);
    border-left-color: var(--ajrak-red);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background-color: var(--admin-bg);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--admin-border);
}

.section-header h1 {
    color: var(--ajrak-red);
    font-size: 2rem;
    margin: 0;
}

.section-header p {
    color: var(--admin-text);
    margin: 0.5rem 0 0 0;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--admin-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--ajrak-red);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ajrak-red), var(--ajrak-black));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ajrak-white);
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--ajrak-red);
    margin: 0;
}

.stat-content p {
    color: var(--admin-text);
    margin: 0;
    font-size: 0.9rem;
}

/* Dashboard Actions */
.dashboard-actions {
    margin-top: 2rem;
}

.action-card {
    background: var(--admin-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.action-card h3 {
    margin-bottom: 1rem;
    color: var(--ajrak-red);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Grid Layouts */
.members-grid,
.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.member-card,
.memory-card {
    background: var(--admin-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.member-card:hover,
.memory-card:hover {
    transform: translateY(-5px);
}

.member-photo,
.memory-photo {
    height: 200px;
    background: var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text);
    font-size: 3rem;
}

.member-info,
.memory-info {
    padding: 1.5rem;
}

.member-info h3,
.memory-info h3 {
    color: var(--ajrak-red);
    margin-bottom: 0.5rem;
}

.member-role {
    color: var(--admin-text);
    font-weight: 500;
    margin-bottom: 1rem;
}

.member-actions,
.memory-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Tabs */
.content-tabs,
.design-tabs {
    background: var(--admin-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-buttons {
    display: flex;
    background: var(--admin-border);
    border-bottom: 1px solid var(--admin-border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-text);
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--ajrak-red);
    color: var(--ajrak-white);
}

.tab-btn:hover:not(.active) {
    background: rgba(179, 34, 34, 0.1);
}

.tab-content {
    padding: 2rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: var(--admin-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-card h3 {
    color: var(--ajrak-red);
    margin-bottom: 1rem;
}

.backup-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--admin-card);
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.modal-header h2 {
    color: var(--ajrak-red);
    margin: 0;
}

.close {
    color: var(--admin-text);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--ajrak-red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--admin-border);
}

/* Form Elements */
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--ajrak-red);
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--ajrak-white);
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--ajrak-red);
}

input[type="file"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px dashed var(--admin-border);
    border-radius: 5px;
    background-color: var(--admin-bg);
    cursor: pointer;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

/* Color Controls */
.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Logo Preview */
.logo-preview {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--ajrak-white);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.2rem;
}

/* Messages */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1500;
}

.message {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    color: var(--ajrak-white);
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.message.success {
    background-color: var(--admin-success);
}

.message.error {
    background-color: var(--admin-danger);
}

.message.warning {
    background-color: var(--admin-warning);
    color: var(--ajrak-black);
}

.message.info {
    background-color: var(--admin-info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Messages */
.error-message {
    color: var(--admin-danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.info-box h4 {
    color: #1976d2;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.info-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.info-box li {
    color: #424242;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Security Warning Styles */
.security-warning {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.security-warning i {
    font-size: 16px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-footer p {
    margin: 4px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.security-info {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Session timeout warning */
.session-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Security status indicator */
.security-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1000;
}

.security-status.secure {
    background: rgba(46, 204, 113, 0.9);
}

.security-status.warning {
    background: rgba(241, 196, 15, 0.9);
}

.security-status.danger {
    background: rgba(231, 76, 60, 0.9);
}

/* Enhanced form security */
.form-group input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-group input.invalid {
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

/* Loading security indicator */
.security-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Student Security Alerts */
.security-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
    z-index: 10000;
    max-width: 400px;
    animation: slideDown 0.3s ease-out;
}

.security-alert .alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-alert i {
    font-size: 20px;
    color: #fff;
}

.security-alert strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.security-alert p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.security-alert button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.security-alert button:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Student-friendly message styles */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.message-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.message-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.message-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.message-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .members-grid,
    .memories-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}
