/* Professional Enhancement Styles */

/* Error Handling & Validation */
.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error::before {
    content: "⚠";
    font-size: 0.75rem;
}

input.error, select.error, textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.inline-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin: 0.5rem 0;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 100px;
    border-radius: 8px;
}

/* Accessibility */
.keyboard-navigation *:focus {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px !important;
}

.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;
}

/* High Contrast Mode */
.high-contrast {
    --text: #000000;
    --background: #ffffff;
    --card: #ffffff;
    --border: #000000;
    --accent: #0000ff;
    --accent-2: #ff0000;
    --muted: #666666;
}

.high-contrast * {
    border-color: #000000 !important;
    box-shadow: none !important;
}

.high-contrast button {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.high-contrast .btn-primary {
    background: #0000ff !important;
    color: #ffffff !important;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.toast-content i {
    font-size: 1.25rem;
}

.toast.success i {
    color: #10b981;
}

.toast.error i {
    color: #ef4444;
}

.toast.warning i {
    color: #f59e0b;
}

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 4px;
    margin-left: auto;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* Global Search */
.global-search-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
}

.global-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.search-modal .modal-content {
    max-width: 600px;
    width: 90%;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.search-result {
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result:hover {
    background: rgba(255, 255, 255, 0.05);
}

.result-text {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.result-page {
    font-size: 0.875rem;
    color: var(--muted);
}

.no-results {
    text-align: center;
    color: var(--muted);
    padding: 2rem;
    font-style: italic;
}

/* Session Expired Modal */
.session-expired-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

.session-expired-modal h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.session-expired-modal p {
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Enhanced Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

/* Enhanced Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Progress Indicators */
.progress-indicator {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .global-search-btn {
        bottom: 80px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
        min-width: auto;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .search-header {
        padding: 1rem;
    }

    .search-results {
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .global-search-btn,
    .toast,
    .modal,
    .sidebar,
    .loading-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* Professional Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.875rem;
}

/* Version Badge */
.version-badge {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1000;
    opacity: 0.7;
}
    


/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
}

/* Focus Visible */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Tooltip System */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.tooltip:hover::after {
    opacity: 1;
}

/* Help System */
.help-btn, .export-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.help-btn:hover, .export-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.help-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.help-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.help-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.help-option i {
    font-size: 1.5rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.help-option h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.help-option p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

/* Accessibility Options */
.accessibility-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.toggle-option span {
    color: var(--text);
    font-weight: 500;
}

.toggle-option small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: normal;
}

/* Keyboard Shortcuts Modal */
.shortcuts-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.shortcut-item kbd {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0.25rem;
}

.shortcut-item span {
    color: var(--text);
    font-weight: 500;
}

/* Export Options */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.export-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.export-option i {
    font-size: 1.5rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.export-option h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.export-option p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

/* Accessibility Info */
.accessibility-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.accessibility-info h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.accessibility-info p {
    margin: 0.25rem 0;
    color: var(--muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accessibility-info kbd {
    background: var(--accent);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Large Text Mode Enhancements */
.large-text {
    font-size: 1.125rem !important;
}

.large-text h1 {
    font-size: 2.5rem !important;
}

.large-text h2 {
    font-size: 2rem !important;
}

.large-text h3 {
    font-size: 1.5rem !important;
}

.large-text button {
    font-size: 1.125rem !important;
    padding: 1rem 1.5rem !important;
}

.large-text .modal-content {
    font-size: 1.125rem !important;
}

/* Reduced Motion */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Enhanced User Info Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: var(--text);
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Tours Modal */
.tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.tour-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.tour-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.tour-option i {
    font-size: 1.5rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.tour-option h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.tour-option p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.tour-actions {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Status Indicators */
.status-indicator {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-indicator.show {
    opacity: 1;
}

.status-indicator h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 0.875rem;
}

.status-indicator .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.25rem 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.status-indicator .status-value {
    color: var(--accent);
    font-weight: 600;
}

/* Enhanced Modal Animations */
.modal {
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    animation: modalSlideUp 0.3s ease;
}

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

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .tours-grid {
        grid-template-columns: 1fr;
    }
    
    .shortcuts-grid {
        gap: 0.5rem;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .help-options,
    .export-options,
    .accessibility-options {
        padding: 0.5rem;
    }
    
    .status-indicator {
        right: 10px;
        left: 10px;
        transform: translateY(-50%);
    }
}