/* Override global styles */
.container {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 2rem;
    text-align: left !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    text-align: left;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
}

/* Layout */
.qr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Input Panel */
.input-panel {
    background: var(--nav-submenu-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Type Selector */
.type-selector {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.3rem;
}

.type-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.type-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
}

.type-btn.active {
    background: rgba(77, 171, 247, 0.15);
    color: var(--link-color);
    font-weight: 600;
}

/* Input Sections */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-section label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.input-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
}

.input-section textarea:focus,
.input-section input:focus,
.input-section select:focus {
    border-color: var(--link-color);
}

.input-section input,
.input-section select {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
}

.input-section select {
    cursor: pointer;
}

.input-section select option {
    background: #1e1e1e;
    color: var(--text-color);
}

/* Options */
.options-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
}

.options-section h3 {
    color: var(--link-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.option-row label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 100px;
}

.option-row input[type="range"] {
    flex: 1;
    accent-color: var(--link-color);
}

.option-row span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 45px;
    text-align: right;
}

.option-row input[type="color"] {
    width: 36px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.option-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.option-row input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.colour-text {
    width: 75px;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8rem;
    outline: none;
}

.colour-text:focus {
    border-color: var(--link-color);
}

.option-row select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e1e1e;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.option-row select:focus {
    border-color: var(--link-color);
}

.option-row select option {
    background: #1e1e1e;
    color: var(--text-color);
}

/* Preview Panel */
.preview-panel {
    background: var(--nav-submenu-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    width: 100%;
}

.qr-preview canvas,
.qr-preview img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.qr-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
}

.qr-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.qr-placeholder p {
    font-size: 0.9rem;
}

/* Download Actions */
.download-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover:not(:disabled) {
    background: rgba(77, 171, 247, 0.1);
    border-color: rgba(77, 171, 247, 0.3);
    color: var(--link-color);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--link-color) 0%, #339af0 100%);
    color: #121212;
    border: none;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    color: #121212;
    box-shadow: 0 4px 15px rgba(77, 171, 247, 0.4);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.5rem;
    background: var(--nav-submenu-bg);
    border: 1px solid rgba(77, 171, 247, 0.3);
    border-radius: 10px;
    color: var(--link-color);
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Mobile */
@media (max-width: 900px) {
    .qr-layout {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 1rem;
    }
    .download-actions {
        flex-direction: column;
    }
    .download-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
