/* ===== Admin Panel Styles ===== */

:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --dark: #212121;
    --light: #F5F5F5;
    --white: #FFFFFF;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ===== Login Screen ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.5s ease;
}

.logo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-header h1 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.logo-header p {
    color: #666;
    font-size: 0.95rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

/* ===== Admin Panel ===== */
.admin-panel {
    min-height: 100vh;
    background: var(--light);
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: var(--dark);
}

.admin-main {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.admin-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    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;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--border);
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.client-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.client-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.client-logo-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--light);
    padding: 0.5rem;
}

.client-info h3 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.client-info p {
    color: #666;
    font-size: 0.9rem;
}

.client-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 1rem;
}

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

/* ===== Forms ===== */
.client-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-card {
    background: var(--light);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.required {
    color: var(--danger);
}

.optional {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

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

.form-group small {
    color: #666;
    font-size: 0.85rem;
}

/* ===== File Input ===== */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.logo-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.logo-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.logo-preview.empty {
    color: #999;
}

/* ===== Color Picker ===== */
.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 45px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.95rem;
}

/* ===== Sections Builder ===== */
.sections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

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

.section-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.question-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-bottom: 1rem;
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.question-number {
    background: var(--primary);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.question-text {
    flex: 1;
    margin: 0 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.question-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.meta-tag.critical {
    background: #ffebee;
    color: var(--danger);
}

.meta-tag.binary {
    background: #e3f2fd;
    color: var(--primary);
}

.meta-tag.multiple {
    background: #f3e5f5;
    color: #9c27b0;
}

.meta-tag.tooltip {
    background: #fff3e0;
    color: var(--warning);
}

/* ===== Form Actions ===== */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

/* ===== Preview ===== */
.preview-container {
    background: #2d2d2d;
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
}

.preview-container pre {
    color: #f8f8f2;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* ===== Footer ===== */
.admin-footer {
    background: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ===== Animations ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .admin-header .container {
        flex-direction: column;
        gap: 1rem;
    }

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

    .clients-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: #e8f5e9;
    color: var(--success);
}

.status-badge.inactive {
    background: #fbe9e7;
    color: var(--danger);
}

/* ===== Quick Access Section ===== */
.quick-access-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.quick-access-section .section-header h2 {
    color: white;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.access-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.access-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.access-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.access-card p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.card-meta {
    font-size: 0.85rem;
    color: #999;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 12px;
}

.afamela-card h3 {
    color: #2196F3;
}

.amiif-card h3 {
    color: #4A90E2;
}

.docs-card h3 {
    color: #FF9800;
}