/* Reset and base styles */
* {
    box-sizing: border-box;
}

html, body, h1, h2, h3, h4, h5, h6, p, div, span, input, textarea, select, button {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Container */
.container {
    max-width: 480px;
    width: 100%;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
}

/* Card */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background-color: #f1f5f9;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: #e2e8f0;
}

.tab.active {
    background-color: #667eea;
    color: white;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}

input[type="url"],
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
}

/* Options section */
.options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-group label {
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}

/* Toggle buttons */
.toggle {
    display: flex;
    gap: 0.5rem;
    background-color: #f1f5f9;
    border-radius: 9999px;
    padding: 0.25rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background-color: #667eea;
    color: white;
}

.toggle-btn:hover {
    background-color: #e2e8f0;
}

.toggle-btn.active:hover {
    background-color: #5568d3;
}

/* Generate button */
.generate-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

/* Output section */
.output {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-top: 2rem;
}

/* QR display */
.qr-display {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.qr-display img {
    max-width: 100%;
    height: auto;
}

/* Action buttons */
.actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background-color: #f8fafc;
}

.action-btn:active {
    background-color: #f1f5f9;
}

/* Actions disabled note */
.actions-note {
    text-align: center;
    color: #64748b;
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background-color: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Error message */
.error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

/* Responsive styles */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .output {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .tabs {
        margin-bottom: 1.5rem;
    }

    .tab {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    .options {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .generate-btn {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }

    .qr-display {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .actions {
        gap: 0.75rem;
    }

    .action-btn {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }

    .toast {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: translateY(120%);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Warning message */
.warning {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Embed toggle group */
.embed-toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.embed-toggle-group label {
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #1e293b;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-content ul {
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.modal-content li {
    margin-bottom: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions .action-btn {
    flex: 1;
}

.modal-actions .action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-actions .action-btn.primary:hover {
    opacity: 0.9;
}

/* Disabled action buttons */
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.action-btn:disabled:hover {
    border-color: #e2e8f0;
    color: #334155;
    background-color: white;
}
