/**
 * Shared Color Schema Styles
 * Universal styling system for all applications
 */

/* Common Base Styles with Color Schema Support */
body {
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Headers and Navigation */
.header, .navbar, .nav-header, .header-section {
    background: var(--header-gradient, linear-gradient(135deg, #166534 0%, #15803d 100%)) !important;
    color: var(--text-light, #ffffff) !important;
    transition: all 0.3s ease;
}

/* Buttons */
.btn-primary, .primary-btn, .submit-btn {
    background: var(--primary-color, #166534) !important;
    border-color: var(--primary-color, #166534) !important;
    color: var(--text-light, #ffffff) !important;
    transition: all 0.3s ease;
}

.btn-primary:hover, .primary-btn:hover {
    background: var(--dark-color, #14532d) !important;
    border-color: var(--dark-color, #14532d) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-secondary, .secondary-btn {
    background: var(--secondary-color, #15803d) !important;
    border-color: var(--secondary-color, #15803d) !important;
    color: var(--text-light, #ffffff) !important;
}

.btn-accent, .accent-btn {
    background: var(--accent-color, #22c55e) !important;
    border-color: var(--accent-color, #22c55e) !important;
    color: var(--text-dark, #1f2937) !important;
}

/* Cards and Panels */
.card, .panel, .content-card {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.card:hover, .panel:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header, .panel-header {
    background: var(--card-gradient, linear-gradient(135deg, #15803d, #22c55e)) !important;
    color: var(--text-light, #ffffff) !important;
    border-radius: 12px 12px 0 0;
    padding: 15px 20px;
    font-weight: 600;
}

/* Tables */
.table, .data-table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th, .data-table thead th {
    background: var(--primary-color, #166534) !important;
    color: var(--text-light, #ffffff) !important;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover, .data-table tbody tr:hover {
    background-color: var(--light-color, #dcfce7) !important;
}

/* Forms */
.form-control, .input-field {
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 12px 15px;
}

.form-control:focus, .input-field:focus {
    border-color: var(--primary-color, #166534) !important;
    box-shadow: 0 0 0 0.2rem rgba(22, 101, 52, 0.25) !important;
    outline: none;
}

.form-label, .label {
    color: var(--primary-color, #166534);
    font-weight: 600;
    margin-bottom: 8px;
}

/* Alerts and Messages */
.alert-success, .success-message {
    background: var(--light-color, #dcfce7) !important;
    color: var(--dark-color, #14532d) !important;
    border-color: var(--secondary-color, #15803d) !important;
}

.alert-primary, .primary-message {
    background: var(--light-color, #dcfce7) !important;
    color: var(--primary-color, #166534) !important;
    border-color: var(--primary-color, #166534) !important;
}

/* Progress Bars */
.progress-bar, .progress {
    background: var(--main-gradient, linear-gradient(135deg, #166534 0%, #15803d 100%)) !important;
    transition: all 0.3s ease;
}

/* Sidebars and Navigation */
.sidebar, .nav-sidebar {
    background: linear-gradient(180deg, var(--primary-color, #166534) 0%, var(--dark-color, #14532d) 100%);
    color: var(--text-light, #ffffff);
}

.sidebar a, .nav-sidebar a {
    color: rgba(255,255,255,0.8) !important;
    transition: all 0.3s ease;
}

.sidebar a:hover, .nav-sidebar a:hover {
    color: var(--text-light, #ffffff) !important;
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar a.active, .nav-sidebar a.active {
    background: var(--accent-color, #22c55e);
    color: var(--text-dark, #1f2937) !important;
}

/* Tabs */
.nav-tabs .nav-link.active {
    background: var(--primary-color, #166534) !important;
    color: var(--text-light, #ffffff) !important;
    border-color: var(--primary-color, #166534) !important;
}

.nav-tabs .nav-link {
    color: var(--primary-color, #166534);
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background: var(--light-color, #dcfce7);
}

/* Badges */
.badge, .tag {
    background: var(--primary-color, #166534) !important;
    color: var(--text-light, #ffffff) !important;
    border-radius: 20px;
    padding: 6px 12px;
}

.badge-secondary {
    background: var(--secondary-color, #15803d) !important;
}

.badge-accent {
    background: var(--accent-color, #22c55e) !important;
    color: var(--text-dark, #1f2937) !important;
}

/* Loading Spinners */
.spinner, .loading {
    border-color: var(--light-color, #dcfce7);
    border-top-color: var(--primary-color, #166534);
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.dropdown-item:hover {
    background: var(--light-color, #dcfce7);
    color: var(--primary-color, #166534);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color, #166534);
    border-color: rgba(0,0,0,0.1);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color, #166534);
    border-color: var(--primary-color, #166534);
}

.pagination .page-link:hover {
    background: var(--light-color, #dcfce7);
    color: var(--dark-color, #14532d);
}

/* Modals */
.modal-header {
    background: var(--header-gradient, linear-gradient(135deg, #166534 0%, #15803d 100%));
    color: var(--text-light, #ffffff);
    border-radius: 8px 8px 0 0;
}

.modal-content {
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Custom Schema-Specific Animations */
@keyframes schemaFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schema-animated {
    animation: schemaFadeIn 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sky-color-selector {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
    }
    
    .sky-dropdown {
        min-width: 200px !important;
        max-width: calc(100vw - 40px) !important;
    }
}

/* RTL Support */
[dir="rtl"] .sky-color-selector {
    left: auto !important;
    right: 20px;
}

[dir="rtl"] .sky-dropdown {
    left: auto;
    right: 0;
}

[dir="rtl"] .sidebar a:hover,
[dir="rtl"] .nav-sidebar a:hover {
    transform: translateX(-5px);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card, .panel, .content-card {
        background: rgba(30, 30, 30, 0.95);
        color: #ffffff;
    }
    
    .sky-dropdown {
        background: rgba(30, 30, 30, 0.95);
        color: #ffffff;
    }
    
    .sky-schema-option {
        color: #ffffff !important;
    }
}
