/* ============================================================
   Admin Panel Styles
   Mastermind Gurukul Certificate Management System
   ============================================================ */

:root {
    --admin-primary: #ff6b00;
    --admin-secondary: #1a1a1a;
    --admin-bg: #f5f5f5;
    --admin-sidebar: #2c2c2c;
    --admin-white: #ffffff;
    --admin-text: #333;
    --admin-text-light: #666;
    --admin-border: #ddd;
    --admin-success: #28a745;
    --admin-danger: #dc3545;
    --admin-warning: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--admin-secondary) 0%, #3a3a3a 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--admin-primary);
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--admin-text-light);
    font-size: 14px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--admin-text);
    font-size: 22px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--admin-text);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #e55f00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--admin-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #000;
    transform: translateY(-1px);
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--admin-danger);
    border: 1px solid var(--admin-danger);
    display: block;
}

.message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--admin-success);
    border: 1px solid var(--admin-success);
    display: block;
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Navigation */
.admin-nav {
    width: 250px;
    background: var(--admin-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.nav-brand {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand h2 {
    color: var(--admin-primary);
    font-size: 18px;
    margin-bottom: 5px;
}

.nav-brand p {
    font-size: 12px;
    color: #999;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    color: #ccc;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(255, 107, 0, 0.1);
    color: var(--admin-primary);
    border-left-color: var(--admin-primary);
}

.nav-item .icon {
    font-size: 18px;
}

.nav-user {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #ccc;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(220, 53, 69, 0.1);
    color: var(--admin-danger);
    border: 1px solid var(--admin-danger);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--admin-danger);
    color: white;
}

/* Main Content */
.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
    background: var(--admin-bg);
    min-height: 100vh;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.page-title {
    font-size: 32px;
    color: var(--admin-text);
    margin-bottom: 25px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 48px;
}

.stat-details h3 {
    font-size: 36px;
    color: var(--admin-primary);
    margin-bottom: 5px;
}

.stat-details p {
    font-size: 14px;
    color: var(--admin-text-light);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--admin-text);
}

.recent-list,
.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item,
.distribution-item {
    padding: 12px;
    background: var(--admin-bg);
    border-radius: 6px;
    font-size: 14px;
}

.recent-item strong {
    color: var(--admin-primary);
}

.distribution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.distribution-bar {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    background: var(--admin-primary);
    transition: width 0.5s ease;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input-admin {
    padding: 10px 15px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--admin-bg);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text);
    font-size: 14px;
    border-bottom: 2px solid var(--admin-border);
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--admin-bg);
}

.text-center {
    text-align: center;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-delete {
    background: var(--admin-danger);
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--admin-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(.active) {
    background: var(--admin-bg);
}

.page-btn.active {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}

/* Form */
.cert-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 900px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
    max-width: 200px;
}

/* Upload Container */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.upload-instructions,
.upload-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-instructions h3 {
    margin-bottom: 15px;
    color: var(--admin-text);
}

.upload-instructions ul {
    margin: 20px 0;
    padding-left: 25px;
}

.upload-instructions li {
    margin: 10px 0;
    line-height: 1.6;
}

.file-input-wrapper {
    margin: 20px 0;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px dashed var(--admin-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: var(--admin-primary);
    background: rgba(255, 107, 0, 0.05);
}

.upload-results {
    margin-top: 20px;
    padding: 15px;
    background: var(--admin-bg);
    border-radius: 6px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--admin-border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--admin-text-light);
}

.modal-close:hover {
    color: var(--admin-danger);
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--admin-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-nav {
        width: 70px;
    }

    .admin-content {
        margin-left: 70px;
    }

    .nav-brand p,
    .nav-item span:not(.icon),
    .user-name {
        display: none;
    }

    .nav-item {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .admin-nav {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-content {
        margin-left: 0;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
    }

    .upload-container {
        grid-template-columns: 1fr;
    }
}