/* ALMEA - Main Stylesheet */

:root {
    --color-primary: #14b8a6;
    --color-primary-dark: #0f766e;
    --color-primary-light: #2dd4bf;
    --color-bg-dark: #042f2e;
    --color-bg-mid: #134e4a;
    --color-bg-light: #164e63;
    --color-text: #ffffff;
    --color-text-muted: rgba(153, 246, 228, 0.8);
    --color-text-subtle: rgba(94, 234, 212, 0.6);
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #f87171;
    --color-border: rgba(20, 184, 166, 0.2);
    --color-card: rgba(19, 78, 74, 0.4);
    --color-card-hover: rgba(15, 118, 110, 0.5);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(to bottom, var(--color-bg-dark), var(--color-bg-mid), var(--color-bg-light));
    min-height: 100vh;
    color: var(--color-text);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: rgba(204, 251, 241, 1);
    color: var(--color-bg-mid);
}

.btn-primary:hover {
    background: white;
}

.btn-secondary {
    background: rgba(15, 118, 110, 0.5);
    color: white;
}

.btn-secondary:hover {
    background: rgba(15, 118, 110, 0.7);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    background: rgba(20, 184, 166, 0.1);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.2);
    color: var(--color-error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(19, 78, 74, 0.5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-subtle);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Cards */
.card {
    background: var(--color-card);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 18px;
    font-weight: 500;
}

.card-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: rgba(17, 94, 89, 0.3);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.table tbody tr:hover {
    background: rgba(20, 184, 166, 0.05);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(74, 222, 128, 0.2);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning);
}

.badge-error {
    background: rgba(248, 113, 113, 0.2);
    color: var(--color-error);
}

.badge-info {
    background: rgba(20, 184, 166, 0.2);
    color: var(--color-primary-light);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--color-success);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--color-warning);
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--color-error);
}

.alert-info {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--color-primary-light);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

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

.admin-sidebar {
    width: 260px;
    background: rgba(4, 47, 46, 0.95);
    border-right: 1px solid var(--color-border);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.sidebar-logo {
    font-size: 24px;
    letter-spacing: 0.3em;
    font-weight: 300;
    color: white;
    text-align: center;
}

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

.sidebar-nav-item {
    margin-bottom: 4px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--color-text-muted);
    transition: all 0.3s ease;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: rgba(20, 184, 166, 0.1);
    color: white;
}

.sidebar-nav-link.active {
    border-left: 3px solid var(--color-primary);
}

.sidebar-nav-link svg {
    width: 20px;
    height: 20px;
}

/* Header */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-size: 24px;
    font-weight: 300;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-card);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.primary {
    background: rgba(20, 184, 166, 0.2);
    color: var(--color-primary);
}

.stat-icon.success {
    background: rgba(74, 222, 128, 0.2);
    color: var(--color-success);
}

.stat-icon.warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning);
}

.stat-icon.error {
    background: rgba(248, 113, 113, 0.2);
    color: var(--color-error);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: rgba(17, 94, 89, 0.3);
    color: var(--color-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-item:hover {
    background: rgba(20, 184, 166, 0.2);
    color: white;
}

.pagination-item.active {
    background: var(--color-primary);
    color: var(--color-bg-dark);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg-mid);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--color-border);
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.animate-slideIn { animation: slideIn 0.3s ease-out forwards; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out forwards; }
.animate-bounce { animation: bounce 0.6s ease-in-out infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(20, 184, 166, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(20, 184, 166, 0.5); }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .admin-wrapper {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 13px;
    }
}
