/* Main CSS - Shared styles across the site */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #1a1a1b;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

p {
    margin: 0 0 1rem 0;
}

a {
    color: #0079d3;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ff4500;
}

/* Utility Classes */
.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;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff4500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Elements */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 16px;
    border: 1px solid #edeff1;
    border-radius: 8px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0079d3;
    box-shadow: 0 0 0 3px rgba(0, 121, 211, 0.1);
}

input:invalid, textarea:invalid, select:invalid {
    border-color: #ea0027;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #ff4500;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #ff6314;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #1a1a1b;
    border: 2px solid #edeff1;
}

.btn-secondary:hover:not(:disabled) {
    border-color: #ff4500;
    color: #ff4500;
}

.btn-outline {
    background-color: transparent;
    color: #0079d3;
    border: 2px solid #0079d3;
}

.btn-outline:hover:not(:disabled) {
    background-color: #0079d3;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Card Component */
.card {
    background: white;
    border: 1px solid #edeff1;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edeff1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    margin-bottom: 16px;
}

.card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #edeff1;
}

/* Modal Component */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    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: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7c7c83;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
    color: #1a1a1b;
    background-color: #f8f9fa;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border: 1px solid #edeff1;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #46d160;
}

.toast-error {
    border-left: 4px solid #ea0027;
}

.toast-warning {
    border-left: 4px solid #ffd635;
}

.toast-info {
    border-left: 4px solid #0079d3;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-success .toast-icon {
    color: #46d160;
}

.toast-error .toast-icon {
    color: #ea0027;
}

.toast-warning .toast-icon {
    color: #ffd635;
}

.toast-info .toast-icon {
    color: #0079d3;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin: 0 0 4px 0;
}

.toast-message {
    margin: 0;
    color: #7c7c83;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #7c7c83;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.toast-close:hover {
    color: #1a1a1b;
    background-color: #f8f9fa;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .modal-body {
        padding-top: 16px;
        padding-bottom: 16px;
    }
    
    .modal-footer {
        padding-bottom: 16px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border: 2px solid #000;
    }
    
    .btn-secondary {
        border-color: #000;
        color: #000;
    }
    
    .card {
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}