/* Reusable Components */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-8);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1;
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-calm);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 111, 244, 0.08), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-calm);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-calm);
    background: var(--gradient-secondary);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-calm);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--calm-blue);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Section Titles */
.section-title {
    font-size: var(--fs-4xl);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-12);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-warm);
    border-radius: var(--radius-full);
}

@media (max-width: 768px) {
    .section-title {
        font-size: var(--fs-3xl);
        margin-bottom: var(--space-8);
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-calm);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    padding: var(--space-8);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    background: var(--calm-blue);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--calm-teal);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: var(--fw-medium);
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    min-height: 44px;
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.10);
    outline: none;
}

.form-control:invalid {
    border-color: var(--accent-dark);
}

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

/* Select Dropdown */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236EC1E4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: var(--space-10);
    appearance: none;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Checkbox and Radio */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: border-color var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-fixed);
    display: flex;
    background: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.lang-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    min-height: 36px;
}

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

.lang-btn:hover:not(.active) {
    background: var(--calm-blue);
    color: var(--primary-color);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(126, 214, 192, 0.12);
    color: var(--accent-dark);
    border-color: var(--accent-color);
}

.alert-error {
    background: rgba(110, 193, 228, 0.10);
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

.alert-warning {
    background: rgba(255, 235, 59, 0.08);
    color: #B59F3B;
    border-color: #FFEB3B;
}

.alert-info {
    background: rgba(110, 193, 228, 0.10);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: var(--white);
}

.badge-secondary {
    background: var(--accent-color);
}

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

/* Divider */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-8) 0;
}

.divider-vertical {
    width: 1px;
    background: var(--border-light);
    margin: 0 var(--space-4);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.m-0 { margin: 0; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }

.p-0 { padding: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus trap for accessibility */
.focus-trap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .form-control {
        border-width: 3px;
    }
    
    .card {
        border-width: 2px;
    }
}