/* ==========================================================================
   QR Code Generator - Modern Tech Theme Styles
   ========================================================================== */

/* Header title white on indigo */
.calculator-wrapper h1 {
    color: #ffffff;
}

/* Calculator wrapper - relative for effects */
.calculator-wrapper {
    position: relative;
    overflow: hidden;
}

/* Button icon styling */
.btn-icon {
    display: inline-block;
    font-size: 1.25rem;
    margin-right: 4px;
}

/* ==========================================================================
   Type Selector (Content Type Buttons)
   ========================================================================== */
.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .type-selector {
        grid-template-columns: repeat(6, 1fr);
    }
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.type-btn:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.type-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    border-color: #6366f1;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.type-icon {
    font-size: 1.5rem;
}

.type-text {
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   Input Fields
   ========================================================================== */
.input-group {
    animation: fadeIn 0.3s ease;
}

.input-group.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* Password input wrapper for WiFi */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #6366f1;
}

/* ==========================================================================
   Size Selector
   ========================================================================== */
.size-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.size-btn:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.size-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    border-color: #6366f1;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.size-label {
    font-size: 14px;
    font-weight: 600;
}

.size-value {
    font-size: 11px;
    opacity: 0.8;
}

/* ==========================================================================
   Checkbox Styling
   ========================================================================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-label input:checked + .checkbox-custom {
    background: #6366f1;
    border-color: #6366f1;
}

.checkbox-label input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label:hover .checkbox-custom {
    border-color: #6366f1;
}

.checkbox-text {
    line-height: 1.4;
}

/* ==========================================================================
   QR Code Results Section
   ========================================================================== */
.qr-results {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    border-radius: 16px;
    border: 2px solid #a5b4fc;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.qr-results::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    animation: shimmer 3s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.qr-results.hidden {
    display: none;
}

/* ==========================================================================
   QR Code Display
   ========================================================================== */
.qr-display-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.qr-display {
    display: inline-block;
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
    border: 2px solid #a5b4fc;
}

.qr-display canvas,
.qr-display img {
    display: block;
}

.qr-content-preview {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-label {
    font-weight: 600;
    color: #6366f1;
    margin-right: 8px;
}

.preview-text {
    font-family: 'Courier New', Courier, monospace;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.share-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.share-trigger-btn:hover {
    background: #eef2ff;
    transform: translateY(-2px);
}

/* ==========================================================================
   Scan Effect (Visual Feedback)
   ========================================================================== */
.scan-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #6366f1, #818cf8, #6366f1, transparent);
    opacity: 0;
    animation: scanLine 0.8s ease-out forwards;
}

@keyframes scanLine {
    0% {
        top: 0;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ==========================================================================
   FAQ Section (QR Code Theme Accordion)
   ========================================================================== */
.qrcode-faq-section {
    margin-top: 32px;
    padding: 24px 20px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #eef2ff 100%);
    border-radius: 20px;
    border: 2px solid #c7d2fe;
}

.qrcode-faq-section h2 {
    text-align: center;
    color: #4f46e5;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Override base FAQ styles for qrcode theme */
.qrcode-faq-section .faq-list {
    gap: 12px;
}

.qrcode-faq-section .faq-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
    border: 1px solid #c7d2fe;
    transition: all 0.3s ease;
    overflow: hidden;
}

.qrcode-faq-section .faq-item[open] {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.qrcode-faq-section .faq-question {
    padding: 16px 20px;
    color: #4f46e5;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qrcode-faq-section .faq-question::after {
    border-color: #4f46e5;
}

.qrcode-faq-section .faq-question:hover {
    background: rgba(99, 102, 241, 0.05);
}

.qrcode-faq-section .faq-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.qrcode-faq-section .faq-answer {
    padding: 0 20px 16px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.qrcode-faq-section .faq-answer p {
    margin: 0 0 12px 0;
}

.qrcode-faq-section .faq-answer p:last-child {
    margin-bottom: 0;
}

.qrcode-faq-section .faq-answer ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.qrcode-faq-section .faq-answer ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.qrcode-faq-section .faq-answer ul li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    width: 6px;
    height: 6px;
    background: #818cf8;
    border-radius: 50%;
}

/* Disclaimer at bottom */
.qr-disclaimer {
    margin-top: 28px;
    padding: 16px 20px;
    background: white;
    border-radius: 30px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 2px dashed #c7d2fe;
}

.qr-disclaimer span {
    color: #6366f1;
}

/* ==========================================================================
   Generate Button Animation
   ========================================================================== */
.calculate-button {
    position: relative;
    overflow: hidden;
}

.calculate-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.calculate-button:active::after {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Select Dropdown Styling
   ========================================================================== */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .type-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .type-btn {
        padding: 10px 6px;
    }

    .type-icon {
        font-size: 1.25rem;
    }

    .type-text {
        font-size: 11px;
    }

    .size-selector {
        gap: 8px;
    }

    .size-btn {
        padding: 10px 12px;
    }

    .qr-display {
        padding: 12px;
    }

    .qr-content-preview {
        font-size: 12px;
        padding: 10px 12px;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .download-button,
    .share-trigger-btn {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }

    /* FAQ mobile */
    .qrcode-faq-section {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .qrcode-faq-section h2 {
        font-size: 1.25rem;
    }

    .qr-disclaimer {
        padding: 14px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}
