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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e0e6ed;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Ad Space */
.ad-space {
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Generator Section */
.generator-section {
    margin-bottom: 30px;
}

.generator-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.input-group.half {
    flex: 0 1 calc(50% - 7.5px);
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 1rem;
}

.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Color Input Wrapper */
.color-input-wrapper {
    position: relative;
}

.input-group input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
}

.input-group input[type="color"]:hover {
    border-color: var(--primary-color);
}

.input-group input[type="color"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Buttons */
.generate-btn, .reset-btn, .share-btn {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.reset-btn {
    width: 100%;
    background: var(--secondary-color);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    margin-top: 20px;
}

.reset-btn:hover {
    background: var(--border-color);
}

.share-btn {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-btn:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Results */
.results {
    animation: slideIn 0.4s ease;
}

.results.hidden {
    display: none;
}

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

/* QR Display Card */
.qr-display-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Stats Card */
.stats-card {
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: var(--text-dark);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Share Section */
.share-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Error */
.error {
    background: #ffe6e6;
    border: 2px solid var(--error-color);
    color: var(--error-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.error.hidden {
    display: none;
}

/* Info Section */
.info-section {
    background: var(--secondary-color);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.info-section h2 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.info-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.info-section h3 {
    color: var(--text-dark);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-section ol,
.info-section ul {
    margin-left: 20px;
    color: var(--text-light);
    line-height: 1.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 10px;
        background: white;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header .subtitle {
        font-size: 0.95rem;
    }

    .generator-card {
        padding: 20px;
    }

    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .input-group.half {
        flex: 1;
        margin-bottom: 15px;
    }

    .qr-display-card {
        padding: 20px;
    }

    .share-section {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        flex: none;
    }

    .stats-card {
        padding: 15px;
    }
}
