* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-light: #25254a;
    --text-primary: #ffffff;
    --text-secondary: #b4b4d1;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --error: #ff4757;
    --success: #2ed573;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(79, 172, 254, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Card */
.card {
    background: var(--surface);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 60px var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px var(--shadow);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--surface-light);
    padding: 0.5rem;
    border-radius: 16px;
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-icon {
    width: 20px;
    height: 20px;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Tab Content */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

/* Input Group */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-field {
    width: 100%;
    padding: 1rem;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.textarea-field {
    resize: vertical;
    min-height: 100px;
}

.input-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-generate {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.result-card {
    text-align: center;
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qr-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.5s ease-out;
}

.qr-image {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
}

.qr-info {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-break: break-all;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-download {
    flex: 1;
    padding: 1rem 2rem;
    background: var(--success-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.5);
}

.btn-secondary {
    flex: 1;
    padding: 1rem 2rem;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-secondary:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Error Message */
.error-message {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 71, 87, 0.1);
    border: 2px solid var(--error);
    border-radius: 12px;
    color: var(--error);
    text-align: center;
    animation: shake 0.5s ease;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    width: 100%;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ad Sidebar Styles */
.ad-sidebar {
    width: 160px;
    min-width: 160px;
    padding: 2rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ad-sidebar-left {
    border-right: 1px solid var(--border);
}

.ad-sidebar-right {
    border-left: 1px solid var(--border);
}

.ad-container {
    position: sticky;
    top: 2rem;
    text-align: center;
}

.ad-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* AdSense Placeholder Styling */
.adsbygoogle {
    min-height: 600px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ad visibility for different screen sizes */
@media (max-width: 1200px) {
    .ad-sidebar {
        width: 120px;
        min-width: 120px;
        padding: 1rem 0.5rem;
    }
    
    .adsbygoogle {
        min-height: 400px;
    }
}

@media (max-width: 1024px) {
    .ad-sidebar {
        display: none;
    }
    
    body {
        flex-direction: column;
    }
    
    .main-wrapper {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        justify-content: center;
    }

    .button-group {
        flex-direction: column;
    }

    .qr-container {
        padding: 1.5rem;
    }

    .qr-image {
        max-width: 240px;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .card {
        padding: 1rem;
    }

    .qr-image {
        max-width: 200px;
    }
}
