/* ===============================================
   QR CODE GENERATOR - USING MODERNTOOLS UNIFIED THEME
   =============================================== */

/* Use modern tools color scheme */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --accent-color: #8B5CF6;
    --text-color: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --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-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;    
    --radius-2xl: 1.5rem;
    
    /* Spacing variables matching percentage calculator */
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    
    /* Typography variables */
    --font-weight-medium: 500;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-4xl: 2.25rem;
    
    /* Transition variables */
    --transition-base: 0.15s ease-in-out;
    
    /* Inverse text for dark backgrounds */
    --text-inverse: #FFFFFF;
    
    /* Gray color scale for consistency */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    
    /* Additional colors for QR generator functionality */
    --success-color: #10B981;
    --success-light: #A7F3D0;
    --warning-color: #F59E0B;
    --warning-light: #FDE68A;
    
    /* Aliases for compatibility */
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

/* Dark theme using exact same colors as percentage calculator */
[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    
    /* Gray color scale for dark theme */
    --gray-100: #374151;
    --gray-200: #4B5563;
    --gray-300: #6B7280;
    --gray-400: #9CA3AF;
    
    /* Aliases for compatibility */
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

/* Theme-aware background support */
body {
    background: var(--bg-primary);
}

/* Main Layout */
.main-content {
    min-height: 100vh;
}

/* ===============================================
   HERO SECTION STYLES (Same as percentage calculator)
   =============================================== */

.tool-hero {
    margin-top: 0;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
}

.tool-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    animation: heroBackgroundPulse 8s ease-in-out infinite;
}

@keyframes heroBackgroundPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    box-shadow: 
        0 15px 35px rgba(59, 130, 246, 0.4),
        0 0 0 10px rgba(59, 130, 246, 0.1),
        0 0 0 20px rgba(59, 130, 246, 0.05);
    animation: heroIconFloat 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

@keyframes heroIconFloat {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    25% { transform: translateY(-5px) scale(1.02) rotate(-3deg); }
    75% { transform: translateY(-2px) scale(1.01) rotate(3deg); }
}

.hero-icon::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 50%;
    z-index: -1;
    opacity: 0.4;
    animation: heroIconGlow 3s ease-in-out infinite;
}

@keyframes heroIconGlow {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.hero-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: conic-gradient(
        from 0deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 25%, 
        var(--accent-color) 50%, 
        var(--primary-color) 75%, 
        var(--secondary-color) 100%
    );
    border-radius: 50%;
    z-index: -2;
    opacity: 0.2;
    animation: heroQRRotate 8s linear infinite;
}

@keyframes heroQRRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-icon i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: heroIconBounce 5s ease-in-out infinite;
    z-index: 2;
}

@keyframes heroIconBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-10deg); }
    75% { transform: scale(1.05) rotate(10deg); }
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroTitleShine 4s ease-in-out infinite;
}

@keyframes heroTitleShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: heroDescriptionFade 3s ease-in-out infinite;
}

@keyframes heroDescriptionFade {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* ===============================================
   GENERATOR MAIN SECTION
   =============================================== */

.generator-main {
    padding: 80px 0;
    background: var(--bg-secondary);
    position: relative;
}

.generator-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ===============================================
   GENERATOR TABS - MATCHING PERCENTAGE CALCULATOR
   =============================================== */

.generator-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    background: var(--bg-secondary);
    padding: var(--space-2);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

/* Dark theme override for generator tabs */
[data-theme="dark"] .generator-tabs {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    flex: 1;
    min-width: 100px;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.tab-button:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.tab-button i {
    font-size: 1rem;
}

/* Dark theme overrides for tab buttons */
[data-theme="dark"] .tab-button {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
}

[data-theme="dark"] .tab-button.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

/* ===============================================
   GENERATOR CARD
   =============================================== */

.generator-card {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.generator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ===============================================
   INPUT SECTIONS
   =============================================== */

.generator-inputs {
    margin-bottom: 40px;
}

.input-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.input-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-header h3 i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.section-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-color);
    background: var(--bg-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

/* Special styling for contact inputs */
.contact-inputs .input-row {
    margin-bottom: 20px;
}

/* WiFi and Email specific styles */
.wifi-inputs,
.email-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Checkbox styling */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===============================================
   CUSTOMIZATION PANEL
   =============================================== */

.customization-panel {
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.customization-panel h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.customization-panel h3 i {
    color: var(--accent-color);
}

.customization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.custom-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.custom-group input,
.custom-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: 0.95rem;
    color: var(--text-color);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.custom-group input[type="color"] {
    padding: 5px;
    height: 45px;
    cursor: pointer;
}

.custom-group input:focus,
.custom-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===============================================
   GENERATE BUTTON
   =============================================== */

.generate-section {
    text-align: center;
}

.generate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn i {
    font-size: 1.3rem;
}

/* ===============================================
   PREVIEW SECTION
   =============================================== */

.preview-section {
    margin-top: 40px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-card {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.preview-header {
    margin-bottom: 30px;
}

.preview-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.preview-header h3 i {
    color: var(--success-color);
}

.preview-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

.qr-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-md);
}

/* ===============================================
   DOWNLOAD OPTIONS
   =============================================== */

.download-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.download-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.png-btn:hover {
    background: var(--success-color);
    border-color: var(--success-color);
}

.svg-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .tool-hero {
        padding: 100px 0 60px;
    }
    
    .hero-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 25px;
    }
    
    .hero-icon i {
        font-size: 2.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .generator-main {
        padding: 60px 0;
    }
    
    .generator-card {
        padding: 25px 20px;        margin: 0 15px;
    }
    
    .generator-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: auto;
        text-align: center;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .customization-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .customization-panel {
        padding: 20px;
    }
    
    .preview-card {
        padding: 25px 20px;
    }
    
    .download-options {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .generator-card {
        margin: 0 10px;
        padding: 20px 15px;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .generate-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
}

/* ===============================================
   LOADING AND ERROR STATES
   =============================================== */

.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ===============================================
   LOADING INDICATOR & MESSAGES
   =============================================== */

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin: 1rem 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-height: 120px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* Message Container */
.message-container {
    margin: 1rem 0;
    z-index: 10;
}

.message {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-base);
    font-weight: 500;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.message i {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

.message.success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid var(--success-color);
}

.message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.message.warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid var(--warning-color);
}

/* Dark theme messages */
[data-theme="dark"] .message.success {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #047857;
}

[data-theme="dark"] .message.error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

[data-theme="dark"] .message.warning {
    background: #78350f;
    color: #fde68a;
    border-color: #d97706;
}

/* Error Messages for Input Validation */
.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.25rem;
}

[data-theme="dark"] .error-message {
    color: #fca5a5;
}

/* QR Info Styling */
#qrInfo {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-base);
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

#qrInfo p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#qrInfo strong {
    color: var(--text-color);
    font-weight: 600;
}
