﻿:root {
    /* Brand Colors */
    --primary-blue: #1e90ff;
    --secondary-blue: #182a72;
    --third-blue: #1e1e1e;
    --secondary-yellow: #ffd401;
    --primary-color: #007bff;
    --border-color: #ccc;
    --input-bg: #fff;
    --form-bg: #f6f9ff;
    --focus-border: #ffcb00;
    /* Extended Color Palette */
    --success: #28a745;
    --success-hover: #218838;
    --error: #dc3545;
    --error-hover: #c82333;
    --warning: #ffc107;
    --warning-hover: #e0a800;
    --info: #17a2b8;
    --info-hover: #138496;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    /* Typography */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-primary: system-ui;
    --font-secondary: Roboto;
    --font-third: Noto Sans;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.930rem;
    --font-size-md: 1.0625rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --line-height-base: 1.5;
    --line-height-tight: 1.25;
    --line-height-relaxed: 1.75;
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    /* Borders */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.15);
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* ========================================
   BASE STYLES
   ======================================== */

html, body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--gray-900);
}

/* ========================================
   FORM CONTROLS
   ======================================== */

input,
select,
textarea,
input:not([type="checkbox"]):not([type="radio"]),
.mud-input-root input {
    width: 100%;
    background-color: var(--input-bg);
    border: none;
    border-bottom: 3px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    /*    padding: var(--space-sm) var(--space-md);*/
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-base);
    box-shadow: none;
}

    input:focus,
    select:focus,
    textarea:focus,
    .mud-input-root input:focus {
        outline: none;
        border-color: var(--focus-border) !important;
        box-shadow: none !important;
    }

    input::placeholder,
    textarea::placeholder {
        color: var(--gray-600);
        opacity: 0.7;
    }

    input:disabled,
    select:disabled,
    textarea:disabled {
        background-color: var(--gray-100);
        cursor: not-allowed;
        opacity: 0.7;
    }

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   LABELS
   ======================================== */

label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

    label.required::after {
        content: " *";
        color: var(--error);
    }

/* ========================================
   BUTTONS
   ======================================== */

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-decoration: none;
    line-height: 1.5;
}

.btn.btn {
    padding: var(--space-sm) var(--space-lg);
    /*border: none;*/
    /*border-radius: var(--radius-md);*/
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-base);
    /*background: var(--primary-color);*/
    /*color: white;*/
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-decoration: none;
    line-height: 1.5;
}

button:hover,
.btn:hover {
    background: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

button:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Button Variants */
.btn-primary {
    background: var(--primary-color);
}

    .btn-primary:hover {
        background: var(--primary-blue);
    }

.btn-success {
    background: var(--success);
}

    .btn-success:hover {
        background: var(--success-hover);
    }

.btn-error,
.btn-danger {
    background: var(--error);
}

    .btn-error:hover,
    .btn-danger:hover {
        background: var(--error-hover);
    }

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

    .btn-warning:hover {
        background: var(--warning-hover);
        color: var(--gray-900);
    }

.btn-secondary {
    background: var(--gray-600);
}

    .btn-secondary:hover {
        background: var(--gray-700);
    }

/* Button Sizes */
.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-md);
}

/* ========================================
   VALIDATION STYLES
   ======================================== */

.validation-message {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
    display: block;
}

.validation-summary {
    color: var(--error);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-control.is-invalid,
.invalid {
    border-color: var(--error) !important;
    border-bottom-color: var(--error) !important;
}

.form-control.is-valid,
.valid.modified:not([type=checkbox]) {
    border-color: var(--success) !important;
    border-bottom-color: var(--success) !important;
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */

.card,
.form-card {
    background: var(--input-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    transition: box-shadow var(--transition-base);
    margin-bottom: var(--space-lg);
}

.form-card {
    margin-top: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--gray-200);
}

.card-body {
    padding: var(--space-md);
}

.card-footer {
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-md);
}

/* ========================================
   TABLES
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--input-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background: var(--gray-50);
}

th {
    padding: var(--space-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
    font-size: var(--font-size-base);
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    border-color: var(--error);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: var(--info);
    color: #1e40af;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-align: center;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-error,
.badge-danger {
    background: var(--error);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.badge-info {
    background: var(--info);
    color: white;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--gray-600);
    color: white;
}

/* ========================================
   FORM GROUPS
   ======================================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

    .form-row > * {
        flex: 1;
    }

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-success {
    color: var(--success) !important;
}

.text-error,
.text-danger {
    color: var(--error) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--gray-600) !important;
}

.bg-success {
    background: var(--success) !important;
}

.bg-error,
.bg-danger {
    background: var(--error) !important;
}

.bg-warning {
    background: var(--warning) !important;
}

.bg-info {
    background: var(--info) !important;
}

.bg-primary {
    background: var(--primary-color) !important;
}

.fw-regular {
    font-weight: var(--font-weight-regular);
}

.fw-medium {
    font-weight: var(--font-weight-medium);
}

.fw-semibold {
    font-weight: var(--font-weight-semibold);
}

.fw-bold {
    font-weight: var(--font-weight-bold);
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-base {
    font-size: var(--font-size-base);
}

.text-md {
    font-size: var(--font-size-md);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

/* ========================================
   CHECKBOXES & RADIO BUTTONS
   ======================================== */

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin-right: var(--space-xs);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

    .form-check label {
        margin-bottom: 0;
        cursor: pointer;
    }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    button,
    .btn {
        width: 100%;
        margin-bottom: var(--space-sm);
    }

    .card,
    .form-card {
        padding: var(--space-md);
    }

    .form-row {
        flex-direction: column;
    }

    table {
        font-size: var(--font-size-sm);
    }

    th, td {
        padding: var(--space-sm);
    }
}
