/* QR Code Generator - Dark Mode Stylesheet with Animations */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Animated Starfield Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(29, 78, 216, 0.15) 0%, transparent 80%),
                radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, transparent 80%);
    z-index: -2;
    animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* Stars Animation */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite linear;
}

.star.small {
    width: 1px;
    height: 1px;
    animation-duration: 2s;
}

.star.medium {
    width: 2px;
    height: 2px;
    animation-duration: 3s;
    box-shadow: 0 0 6px #ffffff;
}

.star.large {
    width: 3px;
    height: 3px;
    animation-duration: 4s;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.8);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: translateY(0px); }
    25% { opacity: 1; transform: translateY(-10px); }
    50% { opacity: 0.5; transform: translateY(-5px); }
    75% { opacity: 0.8; transform: translateY(-15px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.header p {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #a1a1aa;
    margin-bottom: 20px;
}

.card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 32px 64px -12px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tabs {
    display: flex;
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
}

.tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    color: #a1a1aa;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    color: #8b5cf6;
    transform: translateY(-2px);
}

.tab.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: #ffffff;
    border-bottom: 3px solid #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.tab-content {
    display: none;
    padding: 30px;
    animation: slideIn 0.5s ease-out;
}

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

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

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

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e5e7eb;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(30, 41, 59, 0.5);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.input-group input[type="text"]::placeholder,
.input-group input[type="password"]::placeholder,
.input-group textarea::placeholder {
    color: #9ca3af;
}

.input-group input[type="text"]:focus,
.input-group input[type="password"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 0 20px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.input-group textarea {
    min-height: 150px;
    resize: vertical;
}

.customization-panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.customization-panel:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.customization-panel h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.custom-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.custom-item {
    display: flex;
    flex-direction: column;
}

.custom-item label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #d1d5db;
}

.custom-item input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

.custom-item input[type="range"]:hover {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.custom-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: all 0.2s ease;
}

.custom-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
}

.custom-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.custom-item input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    transition: all 0.3s ease;
}

.custom-item input[type="color"]:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.custom-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(30, 41, 59, 0.5);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.custom-item select:hover,
.custom-item select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.custom-item select option {
    background: #1e293b;
    color: #ffffff;
}

.custom-item .value-display {
    font-size: 0.85rem;
    color: #06b6d4;
    margin-top: 4px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
    color: white;
    width: 100%;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.6) 0%, rgba(6, 182, 212, 0.4) 100%);
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.results {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: #ffffff;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qr-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.qr-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.qr-preview canvas {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: white;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.qr-preview canvas:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.qr-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(15px);
    animation: slideInGrid 0.6s ease-out;
}

@keyframes slideInGrid {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qr-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

.qr-item canvas {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: white;
    margin-bottom: 12px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.qr-item canvas:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.qr-item .qr-label {
    font-size: 0.85rem;
    color: #a1a1aa;
    margin-bottom: 10px;
    word-break: break-all;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.qr-item .btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

.info-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.footer {
    text-align: center;
    color: #a1a1aa;
    margin-top: 30px;
    padding: 20px;
    opacity: 0.8;
}

.footer a {
    color: #8b5cf6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #06b6d4;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Smooth Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: #8b5cf6;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .custom-row {
        grid-template-columns: 1fr;
    }

    .qr-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .container {
        padding: 15px;
    }

    body {
        padding: 15px;
    }

    .card {
        border-radius: 16px;
    }

    .tab {
        padding: 15px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .tab {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .qr-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .customization-panel {
        padding: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .custom-row {
        gap: 15px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .star {
        animation: none;
    }
    
    body::before {
        animation: none;
    }
}

/* WiFi QR Code Tab Specific Styles */
.input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.wifi-info {
    color: #a1a1aa;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.wifi-info strong {
    color: #8b5cf6;
    font-weight: 600;
}

/* Checkbox styling for hidden network */
.custom-item input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    position: relative;
}

.custom-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    border-color: #8b5cf6;
}

.custom-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.custom-item label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

/* Password input adjustment for toggle button */
.input-group input[type="password"] {
    padding-right: 45px;
}