/**
 * Asset CMS - UI/UX Enhancements
 * Phase 8: Animations, Mobile Menu, Accessibility, Polish
 */

/* ============================================================================
   TABLE OF CONTENTS
   ============================================================================
   
   SECTION 1:  Animations & Transitions (lines 6-72)
   SECTION 2:  Dismissible Alerts (lines 73-120)
   SECTION 3:  Mobile Hamburger Menu (lines 121-241)
   SECTION 4:  Tooltips (lines 242-270)
   SECTION 5:  Enhanced Focus States (lines 271-291)
   SECTION 6:  Enhanced Typography (lines 292-339)
   SECTION 7:  Enhanced Buttons (lines 340-386)
   SECTION 8:  Smooth Page Transitions (lines 387-404)
   SECTION 9:  Enhanced Form Styles (lines 405-461)
   SECTION 10: Enhanced Tables (lines 462-476)
   SECTION 11: Progress Indicators (lines 477-487)
   SECTION 12: Badges & Labels (lines 488-495)
   SECTION 13: Empty States (lines 496-517)
   SECTION 14: Notification Toasts (lines 518-559)
   SECTION 15: Enhanced Asset Cards (lines 560-576)
   SECTION 16: Smooth Scrollbar (lines 577-599)
   SECTION 17: Focus Visible (lines 600-612)
   SECTION 18: Improved Spacing System (lines 613-629)
   SECTION 19: Breadcrumb Enhancement (lines 630-651)
   SECTION 20: Enhanced Shadows & Depth (lines 652-670)
   SECTION 21: Skeleton Loading (lines 671-699)
   SECTION 22: Improved Modal Styling (lines 700-735)
   SECTION 23: Enhanced Mobile Experience (lines 736-825)
   SECTION 24: Print Styles (lines 826-862)
   SECTION 25: Accessibility Improvements (lines 863-906)
   SECTION 26: Performance Optimizations (lines 907-end)
   
   ============================================================================
 */

/* ============================================================================
   ANIMATIONS & TRANSITIONS
   ============================================================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade animate class - DISABLED */
.fade-animate {
    opacity: 1; /* Changed from 0 to 1 to prevent hiding */
}

.fade-in-up {
    /* Animation disabled */
    opacity: 1;
}

/* Row highlight animation */
.row-highlight {
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 123, 255, 0.1);
    }
}

/* ============================================================================
   DISMISSIBLE ALERTS
   ============================================================================ */

.alert {
    position: relative;
    padding-right: 45px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 5px;
    transition: opacity 0.3s ease;
}

.alert-close:hover {
    opacity: 1;
}

.alert-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Alert icons */
.alert-icon::before {
    content: '';
    font-size: 20px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}


.success-icon::before {
    content: '✅';
}

.danger-icon::before,
.alert-error::before {
    content: '❌';
}

.warning-icon::before {
    content: '⚠️';
}

.info-icon::before {
    content: 'ℹ️';
}

/* ============================================================================
   MOBILE HAMBURGER MENU
   ============================================================================ */

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: var(--primary-color);
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        z-index: 100;
        overflow-y: auto;
        flex-wrap: nowrap;
        gap: 0;
        font-size: 16px;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        padding: 15px;
        border-radius: 6px;
        margin: 5px 0;
        text-align: center;
    }
    
    .nav-user {
        margin: 10px 0;
        text-align: center;
    }
    
    .nav-links .language-selector-form {
        width: 100%;
        margin: 10px 0;
    }
    
    .nav-links .language-select {
        width: 100%;
        text-align: left;
        padding: 12px;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    /* Mobile menu backdrop */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        /* Animation disabled */
    }
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */

.tooltip {
    position: fixed;
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 250px;
    word-wrap: break-word;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-color) transparent transparent transparent;
}

/* ============================================================================
   ENHANCED FOCUS STATES (Accessibility)
   ============================================================================ */

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Skip to content link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================================
   ENHANCED TYPOGRAPHY
   ============================================================================ */

/* Better line height for readability */
.asset-content,
.detailed-content,
.textarea-value {
    line-height: 1.8;
    font-size: 16px;
}

/* Better heading spacing */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-top: 0;
}

h1 {
    font-size: 32px;
    font-weight: 700;
}

h2 {
    font-size: 26px;
    font-weight: 600;
}

h3 {
    font-size: 22px;
    font-weight: 600;
}

h4 {
    font-size: 18px;
    font-weight: 600;
}

/* Code blocks */
code, pre {
    font-family: 'Courier New', Consolas, monospace;
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
}

pre {
    padding: 15px;
    overflow-x: auto;
}

/* Better link styling */
a {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* ============================================================================
   ENHANCED BUTTONS
   ============================================================================ */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    transform: translateY(-2px);
}

.btn:not(:disabled):active {
    transform: translateY(0);
}

/* ============================================================================
   SMOOTH PAGE TRANSITIONS
   ============================================================================ */

.main-content {
    /* Animation disabled */
    opacity: 1;
}

.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

/* ============================================================================
   ENHANCED FORM STYLES
   ============================================================================ */

/* Better form control focus */
.form-control:focus {
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* Input groups with icons */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 45px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 20px;
}

/* Form validation states */
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2328a745'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

/* ============================================================================
   ENHANCED TABLES
   ============================================================================ */

.table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
    background-color: rgba(18, 48, 85, 1);
    border-color: rgba(18, 48, 85, 1);
}

.table tbody tr:hover {
    transform: scale(1.005);
}

/* Zebra striping */
.table-striped tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

/* ============================================================================
   PROGRESS INDICATORS
   ============================================================================ */

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================================================
   BADGES & LABELS
   ============================================================================ */

.badge, .status-badge {
    transition: all 0.2s ease;
}

.badge:hover, .status-badge:hover {
    transform: scale(1.05);
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    /* Animation disabled */
    opacity: 1;
}

.empty-state::before {
    content: '📭';
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================================================
   NOTIFICATION TOASTS (Enhanced Alerts)
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    /* Animation disabled */
}

.toast-icon {
    font-size: 24px;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.toast-close:hover {
    opacity: 1;
}

/* ============================================================================
   ENHANCED ASSET CARDS
   ============================================================================ */

.asset-card {
    position: relative;
    overflow: hidden;
}

.asset-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.asset-card:hover::after {
    left: 100%;
}

/* ============================================================================
   SMOOTH SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============================================================================
   FOCUS VISIBLE (Modern Accessibility)
   ============================================================================ */

*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================================================
   IMPROVED SPACING SYSTEM
   ============================================================================ */

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* ============================================================================
   BREADCRUMB ENHANCEMENT
   ============================================================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 0;
    font-size: 14px;
}

.breadcrumb a {
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb span {
    transition: opacity 0.3s ease;
}

/* ============================================================================
   ENHANCED SHADOWS & DEPTH
   ============================================================================ */

.card {
    box-shadow: var(--shadow-card-subtle);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Elevated cards (important content) */
.card.elevated {
    box-shadow: var(--shadow-card-elevated);
}

/* ============================================================================
   SKELETON LOADING (For Future AJAX)
   ============================================================================ */

.skeleton {
    background: var(--skeleton-shimmer);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
}

/* ============================================================================
   IMPROVED MODAL STYLING (For Future Modals)
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    /* Animation disabled */
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    /* Animation disabled */
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================================
   ENHANCED MOBILE EXPERIENCE
   ============================================================================ */

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .btn-sm {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    /* Better form spacing */
    .form-group {
        margin-bottom: 10px;
    }
    
    /* Improved table mobile view */
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
    
    /* Stack action buttons vertically on mobile */
    .asset-actions,
    .form-actions,
    .action-buttons {
        flex-direction: column;
    }
    
    .asset-actions .btn,
    .form-actions .btn {
        width: 100%;
    }
    
    /* Better mobile cards */
    .stat-card,
    .asset-card,
    .category-card {
        padding: 10px;
    }
    
    /* Improve filter layout on mobile */
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    /* Better mobile navigation spacing */
    .page-header h1 {
        font-size: 26px;
    }
    
    .page-header p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Simplify decision actions on mobile */
    .decision-actions {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    /* Hide navigation and actions when printing */
    .main-nav,
    .main-footer,
    .btn,
    .action-buttons,
    .form-actions,
    .hamburger-menu,
    .flash-messages {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--print-border);
        page-break-inside: avoid;
    }
    
    .asset-detail-header h1 {
        color: black;
    }
    
    /* Show URLs after links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 11px;
        color: var(--text-subtle);
    }
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Screen reader only class */
.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 support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid var(--dark-color);
    }
}

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

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented later if needed */
}

/* ============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================ */

/* Hardware acceleration for animations */
.card,
.btn,
.asset-card,
.nav-links {
    will-change: transform;
}

/* Optimize repaints */
.loading-overlay,
.modal {
    contain: layout style paint;
}

