/* Admin Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-header .header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: white;
}

.admin-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-header h1 i {
    color: #ffd700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

/* Sections */
.form-section,
.list-section,
.default-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section h2,
.list-section h2,
.default-section h2 {
    color: #004080;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group label i {
    color: #004080;
    margin-right: 0.25rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #004080;
    box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.1);
}

.form-group input:readonly,
.form-group input:read-only {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #004080 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-danger:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: #004080;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

/* List Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-controls .search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.list-controls .search-box input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.list-controls .search-box input:focus {
    outline: none;
    border-color: #004080;
}

.list-controls .search-box i {
    position: absolute;
    left: 0.75rem;
    color: #6c757d;
}

.agency-list {
    display: grid;
    gap: 1rem;
}

.agency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.agency-item:hover {
    border-color: #004080;
    background: white;
}

.agency-info h3 {
    color: #004080;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.agency-info .jurisdiction-type {
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agency-info .jurisdiction-type i {
    margin-right: 0.25rem;
}

.agency-contact {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.agency-actions {
    display: flex;
    gap: 0.5rem;
}

.agency-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

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

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.stat-card i {
    font-size: 1.5rem;
    color: #004080;
    margin-bottom: 0.5rem;
}

.stat-card span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-card small {
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Default Section */
.default-section .description {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.default-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
}

.default-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.default-content i {
    font-size: 2.5rem;
    color: #ffc107;
}

.default-content h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.default-content p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    color: #004080;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
    margin-top: 1rem;
}

.drop-zone {
    border: 2px dashed #004080;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.drop-zone.dragover {
    background: #e8f4fd;
    border-color: #0056b3;
}

.drop-zone i {
    font-size: 2.5rem;
    color: #004080;
    margin-bottom: 1rem;
}

.warning {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
}

.warning i {
    color: #856404;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Footer */
.admin-footer {
    background: #343a40;
    color: #adb5bd;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.admin-footer p {
    margin: 0.25rem 0;
}

.admin-footer .footer-link {
    color: #adb5bd;
    text-decoration: none;
}

.admin-footer .footer-link:hover {
    color: white;
}

.text-muted {
    color: #6c757d;
}

.hidden {
    display: none !important;
}

.publish-status {
    min-height: 1.5rem;
    margin: -1rem 0 1.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.publish-status.success {
    color: #198754;
}

.publish-status.error {
    color: #dc3545;
}

/* ── GitHub Sign-in ───────────────────────────────────────────────────────── */

.signin-section .description {
    color: #6c757d;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.signin-form {
    display: flex;
    gap: 0.75rem;
}

.signin-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
}

.signin-form input:focus {
    outline: none;
    border-color: #004080;
}

.signedin-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #d1e7dd;
    border-radius: 8px;
    color: #0f5132;
    font-weight: 600;
}

.signedin-status i {
    margin-right: 0.4rem;
}

/* ── Bulk Import Colleges ─────────────────────────────────────────────────── */

.bulk-import-section .description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.bulk-import-list {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
    max-height: 480px;
    overflow-y: auto;
}

.bulk-import-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.bulk-import-item.already-added {
    opacity: 0.55;
}

.bulk-import-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bulk-import-item .bulk-item-info {
    flex: 1;
    min-width: 0;
}

.bulk-import-item .bulk-item-name {
    font-weight: 600;
    color: #333;
}

.bulk-import-item .bulk-item-coords {
    font-size: 0.8rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.bulk-import-item .bulk-item-radius {
    width: 70px;
    padding: 0.4rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.bulk-import-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Correction Submissions ──────────────────────────────────────────────── */

.corrections-section .description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.corrections-subheading {
    font-size: 1rem;
    color: #004080;
    margin: 1.5rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.corrections-list {
    display: grid;
    gap: 1rem;
}

.correction-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
}

.correction-item .correction-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.correction-item .correction-agency {
    font-weight: 700;
    color: #004080;
}

.correction-item .correction-field-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    background: #e8f4fd;
    color: #004080;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.correction-item .correction-values {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.correction-item .correction-values .old-value {
    color: #dc3545;
    text-decoration: line-through;
}

.correction-item .correction-values .new-value {
    color: #198754;
    font-weight: 600;
}

.correction-item .correction-note {
    font-size: 0.9rem;
    color: #495057;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.correction-item .correction-submitted-by {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.correction-item .correction-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.correction-item .correction-actions .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

/* ── PIN Overlay ──────────────────────────────────────────────────────────── */

.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.pin-overlay.hidden {
    display: none !important;
}

.pin-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.pin-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #004080 0%, #0056b3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.pin-icon i {
    font-size: 2.5rem;
    color: #ffd700;
}

.pin-form h2 {
    color: #004080;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.pin-form p {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.pin-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pin-inputs input {
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 0.25em;
    transition: all 0.3s ease;
}

.pin-inputs input:focus {
    outline: none;
    border-color: #004080;
    box-shadow: 0 0 0 4px rgba(0, 64, 128, 0.15);
}

.pin-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8d7da;
    border-radius: 8px;
}

.pin-btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem;
    font-size: 1.1rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .list-controls {
        flex-direction: column;
    }

    .list-controls .search-box input {
        width: 100%;
    }

    .agency-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .default-card {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}