/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    line-height: 1.6;
}

/* Main content wrapper */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 2-column layout grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .main-wrapper {
        padding: 16px;
    }
}

/* Container styles */
.container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* QR Preview Panel */
.qr-preview-panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    text-align: center;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.qr-display {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-placeholder {
    color: #999;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-placeholder .icon {
    font-size: 48px;
    opacity: 0.5;
}

.qr-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qr-actions button {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    transition: background 0.2s ease;
}

.qr-actions button:hover {
    background: rgba(255,255,255,0.3);
}

.qr-actions button.visible,
.qr-actions button:not([style*="display: none"]) {
    display: block;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
}

/* Sticky preview column */
.preview-sticky {
    position: sticky;
    top: 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    grid-column: 1 / -1;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Language switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-switcher select {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    flex: 1;
    min-width: max-content;
    background: none;
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab:hover {
    background: rgba(255,255,255,0.1);
}

.tab[aria-selected="true"] {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

.tab:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Tab panels */
[role="tabpanel"] {
    display: none;
}

[role="tabpanel"][aria-hidden="false"] {
    display: block;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255,255,255,0.9);
    color: #333;
    transition: box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio groups for WiFi security */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    width: 100%;
    margin-bottom: 16px;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-primary:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    margin: 4px;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 600px) {
    .btn-secondary {
        width: 100%;
        margin: 4px 0;
    }
}

/* QR Preview */
.qr-preview {
    text-align: center;
    margin-bottom: 24px;
}

.qr-canvas {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 20px;
    max-width: 300px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-placeholder {
    color: #999;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-placeholder .icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Ad slots - fixed height to prevent CLS */
.ad-slot {
    min-height: 280px;
    margin: 20px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.ad-slot.header-ad {
    min-height: 100px;
    margin-bottom: 24px;
    grid-column: 1 / -1;
}

.ad-slot.footer-ad {
    margin-top: 40px;
}

@media (max-width: 600px) {
    .ad-slot.footer-ad {
        min-height: 250px;
    }
}

/* Accessibility improvements */
.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;
}

/* Focus indicators */
*:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        border: 2px solid white;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .ad-slot,
    .language-switcher,
    .btn-secondary {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        background: none;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}