/* Mobile-First Design - Cloud Architecture Patterns Gallery */

/* ========== CSS Variables ========== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #0ea5e9;
    --accent-color: #8b5cf6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --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);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ========== Main Content ========== */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* ========== Introduction Section ========== */
.intro {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.intro h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.intro p {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ========== Gallery Grid ========== */
.gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ========== Pattern Cards ========== */
.pattern-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease;
}

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

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.pattern-card h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.pattern-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    flex: 1;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateX(4px);
}

.btn-back {
    background: var(--text-light);
    margin-bottom: 1.5rem;
}

.btn-back:hover {
    background: var(--text-dark);
    transform: translateX(-4px);
}

/* ========== Pattern Detail Page ========== */
.pattern-detail {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.pattern-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.pattern-header .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.pattern-header h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.pattern-section {
    margin-bottom: 2rem;
}

.pattern-section h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.pattern-section p, .pattern-section ul {
    color: var(--text-light);
    line-height: 1.8;
}

.pattern-section ul {
    list-style: none;
    padding-left: 0;
}

.pattern-section ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.pattern-section ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.pros, .cons {
    padding: 1.25rem;
    border-radius: 8px;
}

.pros {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.cons {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.pros h3, .cons h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.pros h3 {
    color: #065f46;
}

.cons h3 {
    color: #991b1b;
}

/* ========== ASCII Diagram ========== */
.diagram {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 1rem;
}

.diagram pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    white-space: pre;
}

/* ========== Footer ========== */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer p {
    font-size: 0.875rem;
    opacity: 0.8;
}

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

/* ========== Tablet Breakpoint (768px+) ========== */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }

    .logo {
        font-size: 2.25rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .intro h2 {
        font-size: 2rem;
    }

    .pattern-detail {
        padding: 2.5rem;
    }

    .pros-cons {
        grid-template-columns: repeat(2, 1fr);
    }

    .diagram pre {
        font-size: 0.85rem;
    }
}

/* ========== Desktop Breakpoint (1024px+) ========== */
@media (min-width: 1024px) {
    .header {
        padding: 3rem 0;
    }

    .logo {
        font-size: 2.5rem;
    }

    .main {
        padding: 3rem 0;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .pattern-card {
        padding: 2rem;
    }

    .intro h2 {
        font-size: 2.5rem;
    }

    .intro p {
        font-size: 1.1rem;
    }

    .pattern-header h1 {
        font-size: 2.5rem;
    }

    .diagram pre {
        font-size: 0.9rem;
    }
}

/* ========== Large Desktop Breakpoint (1280px+) ========== */
@media (min-width: 1280px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Print Styles ========== */
@media print {
    .header, .footer, .btn {
        display: none;
    }

    .pattern-detail {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
