/* Modern, Enhanced UI for Docker Compose Lab */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Modern Color Palette */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e1e3f;
    --bg-code: #0d1421;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-accent: #60a5fa;
    
    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    
    /* Docker Brand Colors */
    --docker-blue: #2496ed;
    --docker-light: #46bcf0;
    
    /* Borders and Shadows */
    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-accent: rgba(59, 130, 246, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&display=swap');

html, body {
    height: auto !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
}

/* Animated background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-xl) 0;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

/* Header */
h1 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: var(--text-primary);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 2px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        box-shadow: 0 0 5px var(--accent-blue);
        opacity: 0.8;
    }
    to { 
        box-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--accent-cyan);
        opacity: 1;
    }
}

/* Docker Logo */
.docker-logo {
    width: clamp(48px, 8vw, 64px);
    height: clamp(48px, 8vw, 64px);
    filter: drop-shadow(0 4px 8px rgba(36, 150, 237, 0.3));
    animation: docker-float 3s ease-in-out infinite;
}

@keyframes docker-float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-8px) rotate(2deg);
    }
    50% { 
        transform: translateY(-4px) rotate(0deg);
    }
    75% { 
        transform: translateY(-8px) rotate(-2deg);
    }
}

/* Introduction Section */
.intro-section {
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.intro-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Content Cards */
.project-structure-box,
.code-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove all bottom spacing from last elements */
.code-container:last-of-type,
.project-structure-box:last-of-type,
.code-examples > *:last-child,
main > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: var(--space-xl) !important;
}

.project-structure-box:hover,
.code-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

/* Card glow effect */
.project-structure-box::before,
.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-structure-box:hover::before,
.code-container:hover::before {
    opacity: 1;
}

/* Snippet Titles */
.snippet-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.snippet-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 2px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(0.8); }
}

/* Code Blocks */
pre {
    background: var(--bg-code) !important;
    border-radius: 12px;
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    border: 1px solid var(--border-subtle);
    overflow-x: auto;
    position: relative;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.hljs {
    background: transparent !important;
    color: var(--text-secondary);
}

code {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--text-secondary);
}

/* Copy Button */
.copy-container {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 10;
}

.copy-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: var(--space-sm) var(--space-md);
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

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

.copy-btn i {
    font-size: 16px;
}

/* Screen reader only content */
.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;
}

/* Enhanced Notification */
.notification {
    position: fixed !important;
    top: var(--space-xl) !important;
    right: var(--space-xl) !important;
    background: rgba(30, 30, 63, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: var(--space-lg) var(--space-xl);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000 !important;
}

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

.notification.hide {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
}

.notification i {
    font-size: 1.25rem;
    color: var(--accent-green);
    flex-shrink: 0;
}

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

/* Progress Bar */
.notification.progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    animation: progress 2.5s linear forwards;
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: var(--space-lg);
    }
    
    h1 {
        font-size: clamp(1.8rem, 4vw, 2.8rem);
        gap: var(--space-md);
    }
    
    .intro-text {
        font-size: 1rem;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
        max-width: 100%;
    }
    
    h1 {
        flex-direction: column;
        gap: var(--space-sm);
        margin-bottom: var(--space-xl);
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
    
    .docker-logo {
        width: clamp(40px, 12vw, 56px);
        height: clamp(40px, 12vw, 56px);
    }
    
    .intro-section {
        margin-bottom: var(--space-xl);
    }
    
    .intro-text {
        font-size: 0.95rem;
        max-width: 100%;
        padding: 0 var(--space-sm);
    }
    
    .project-structure-box,
    .code-container {
        padding: var(--space-md);
        margin-bottom: var(--space-lg);
        border-radius: 12px;
    }
    
    .snippet-title {
        font-size: 1.1rem;
        margin-bottom: var(--space-md);
    }
    
    .snippet-title::before {
        width: 3px;
        height: 20px;
    }
    
    .copy-container {
        top: var(--space-sm);
        right: var(--space-sm);
    }
    
    .copy-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 12px;
        min-width: 32px;
        min-height: 32px;
        border-radius: 6px;
    }
    
    .copy-btn i {
        font-size: 14px;
    }
    
    .notification {
        top: var(--space-sm) !important;
        right: var(--space-sm) !important;
        left: var(--space-sm) !important;
        max-width: none;
        min-width: auto;
        font-size: 0.9rem;
        padding: var(--space-md);
    }
    
    pre {
        padding: var(--space-md);
        font-size: 13px;
        border-radius: 8px;
        margin: var(--space-md) 0;
    }
    
    /* Custom scrollbar for mobile */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    pre::-webkit-scrollbar {
        height: 6px;
        width: 6px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-sm);
    }
    
    h1 {
        font-size: clamp(1.25rem, 8vw, 1.8rem);
        margin-bottom: var(--space-lg);
    }
    
    .docker-logo {
        width: clamp(32px, 15vw, 48px);
        height: clamp(32px, 15vw, 48px);
    }
    
    .intro-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .project-structure-box,
    .code-container {
        padding: var(--space-sm);
        margin-bottom: var(--space-md);
        border-radius: 8px;
    }
    
    .snippet-title {
        font-size: 1rem;
        margin-bottom: var(--space-sm);
    }
    
    .copy-container {
        top: 6px;
        right: 6px;
    }
    
    .copy-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 28px;
        min-height: 28px;
        border-radius: 4px;
    }
    
    .copy-btn i {
        font-size: 12px;
    }
    
    .notification {
        font-size: 0.85rem;
        padding: var(--space-sm) var(--space-md);
        border-radius: 8px;
    }
    
    pre {
        padding: var(--space-sm);
        font-size: 12px;
        margin: var(--space-sm) 0;
        overflow-x: auto;
    }
    
    /* Ensure code doesn't break layout on very small screens */
    code {
        word-break: break-all;
        white-space: pre-wrap;
    }
    
    /* Custom scrollbar for very small screens */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    ::-webkit-scrollbar-thumb {
        border: 1px solid var(--bg-secondary);
    }
    
    pre::-webkit-scrollbar {
        height: 4px;
        width: 4px;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 8px;
    }
    
    h1 {
        font-size: 1.25rem;
        margin-bottom: var(--space-md);
    }
    
    .docker-logo {
        width: 32px;
        height: 32px;
    }
    
    .intro-text {
        font-size: 0.85rem;
    }
    
    .project-structure-box,
    .code-container {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .snippet-title {
        font-size: 0.9rem;
    }
    
    .copy-btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 24px;
        min-height: 24px;
    }
    
    pre {
        padding: 8px;
        font-size: 11px;
    }
}

/* Landscape orientation improvements */
@media (max-height: 500px) and (orientation: landscape) {
    h1 {
        margin-bottom: var(--space-md);
        flex-direction: row;
        gap: var(--space-sm);
    }
    
    .intro-section {
        margin-bottom: var(--space-md);
    }
    
    .project-structure-box,
    .code-container {
        margin-bottom: var(--space-md);
    }
}

/* Focus styles for accessibility */
.copy-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* 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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
    transform: scale(1.05);
}

::-webkit-scrollbar-thumb:active {
    background: var(--accent-blue);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Custom scrollbar for Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--bg-secondary);
}

/* Enhanced code block scrollbars */
pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}
