/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #3b82f6;
    --background-dark: #0a0e1a;
    --background-light: #1a1f2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a9c0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-color: #2d3748;
    --shadow-color: rgba(37, 99, 235, 0.1);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .section, .container, .hero, .nav {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    pre, code {
        overflow-x: auto !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        max-width: 100% !important;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    width: 100%;
    max-width: 100vw;
}

* {
    box-sizing: border-box;
    max-width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    z-index: -2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 100vw;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
        gap: 8px;
        max-width: 60%;
    }
    
    .logo span {
        display: none;
    }
    
    .logo::after {
        content: 'API Portfolio';
        font-size: 1rem;
    }
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(26, 31, 46, 0.95) 100%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .hero {
        padding: 120px 15px 80px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    hyphens: auto;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 2.5rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-preview {
    background: var(--background-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    animation: float 6s ease-in-out infinite;
}

@media (max-width: 768px) {
    .code-preview {
        max-width: 100%;
        width: 100%;
        animation: none;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        margin: 0 auto;
        overflow-x: auto;
    }
    
    .code-content {
        font-size: 0.75rem;
        padding: 15px;
        overflow-x: auto;
        white-space: pre;
        word-wrap: normal;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(37, 99, 235, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.code-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28ca42; }

.code-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 20px;
    background: transparent;
    color: var(--text-primary);
    overflow-x: auto;
}

/* Section Styles */
.section {
    padding: 100px 0;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-wrap: break-word;
    max-width: 100%;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    word-wrap: break-word;
}

/* Overview Section */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.overview-card {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.overview-card:hover::before {
    transform: scaleX(1);
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.1);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.overview-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.overview-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #6b7280;
    transform: translateY(-2px);
}

/* API Demo Section */
.api-demo-container {
    background: var(--background-light);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.demo-section {
    margin-bottom: 3rem;
}

.demo-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
}

.status-display {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-color);
}

/* Reviews Display */
.reviews-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-dark);
}

.review-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.review-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.review-info h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star-rating i {
    font-size: 0.9rem;
}

.star-rating .fas {
    color: #fbbf24;
}

.star-rating .far {
    color: var(--text-secondary);
}

.sentiment-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sentiment-positive {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.sentiment-negative {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.sentiment-neutral {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.review-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
}

.review-actions button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-actions .edit-btn {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

.review-actions .delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* API Log */
.api-log {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    color: #10b981;
}

.api-log .request {
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.api-log .response {
    color: #10b981;
    margin-bottom: 1rem;
}

.api-log .error {
    color: var(--danger-color);
}

.api-log pre {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    padding-left: 1rem;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Documentation Tabs */
.doc-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.doc-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.doc-tab:hover {
    color: var(--primary-color);
}

.doc-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.doc-content {
    display: none;
}

.doc-content.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Endpoint Documentation */
.endpoint-group {
    margin-bottom: 2rem;
}

.endpoint-group h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.endpoint-item {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.method-get {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

.method-post {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.method-put {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.method-delete {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--text-primary);
}

.endpoint-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.endpoint-details {
    margin-top: 1rem;
}

.endpoint-details summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.endpoint-details pre {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Architecture Section */
.architecture-diagram {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.architecture-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.arch-component {
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.arch-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
}

.arch-component h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.arch-component p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.arch-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 1rem;
}

@media (max-width: 768px) {
    .architecture-flow {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .arch-component {
        width: 100%;
        max-width: 280px;
    }
    
    .arch-arrow {
        display: none !important;
    }
}

/* Tech Stack */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tech-item {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tech-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}

.tech-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tech-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tech-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Database Schema Colors */
.schema-users { color: #3b82f6; }
.schema-reviews { color: #10b981; }
.schema-customers { color: #8b5cf6; }
.schema-products { color: #f59e0b; }
.schema-analytics { color: #ef4444; }

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        max-width: 100vw;
        background: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        border-top: 1px solid var(--border-color);
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(45, 55, 72, 0.5);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(37, 99, 235, 0.1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 20px 80px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .hero-subtitle {
        font-size: 2rem;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 2rem;
        flex-wrap: wrap;
    }
    
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
        padding: 0 10px;
        word-wrap: break-word;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-input {
        min-width: auto;
        width: 100%;
    }
    
    .doc-tabs {
        flex-wrap: wrap;
    }
    
    .doc-tab {
        flex: 1;
        min-width: 120px;
    }
    
    .api-log {
        font-size: 0.8rem;
        max-height: 300px;
    }
    
    .reviews-container {
        max-height: 300px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .review-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    .hero-subtitle {
        font-size: 1.6rem;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .container {
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .section-title {
        font-size: 1.7rem;
        padding: 0 5px;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .overview-card {
        padding: 1.5rem;
    }
    
    .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .form-group {
        padding: 1rem;
    }
    
    .api-log {
        font-size: 0.75rem;
        padding: 1rem;
    }
    
    .review-item {
        padding: 1rem;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .nav-link {
        padding: 1.2rem 2rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-btn {
        padding: 0.8rem;
        font-size: 1.6rem;
        min-height: 48px;
        min-width: 48px;
    }
    
    .form-input {
        font-size: 16px !important;
        min-height: 48px;
        padding: 1rem;
    }
    
    .form-textarea {
        font-size: 16px !important;
        min-height: 120px;
        padding: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .nav-menu {
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #e0e0e0;
    }
}

/* Additional Mobile Improvements */
@media (max-width: 768px) {
    /* Better mobile code blocks */
    pre, code {
        font-size: 0.75rem;
        line-height: 1.4;
        overflow-x: auto;
        white-space: pre;
        word-wrap: normal;
        max-width: 100%;
    }
    
    /* Mobile API demo improvements */
    .api-demo-container {
        padding: 1rem;
        margin: 0;
        border-radius: 12px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-input {
        width: 100%;
        min-width: auto;
    }
    
    /* Better mobile reviews display */
    .reviews-container {
        max-height: 250px;
        font-size: 0.85rem;
    }
    
    .review-item {
        padding: 1rem;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .review-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Mobile endpoint documentation */
    .endpoint-item {
        padding: 1rem;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .method-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .endpoint-path {
        font-size: 0.9rem;
        word-break: break-all;
    }
    
    /* Database schema tables mobile */
    .tech-stack {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tech-item {
        padding: 1.5rem;
        text-align: center;
    }
    
    .tech-item i {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile table schema improvements */
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .overview-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    /* Mobile query sections */
    .endpoint-group h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile improvements */
    pre, code {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
        padding: 0.75rem !important;
    }
    
    .arch-component {
        padding: 1rem;
        margin: 0 auto;
        text-align: center;
        max-width: 250px;
    }
    
    .arch-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .arch-component h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .arch-component p {
        font-size: 0.8rem;
    }
    
    /* Smaller hero stats on very small screens */
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .stat {
        min-width: auto;
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    .nav, .hero-visual, .api-demo-container {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
    }
}