:root {
    --bg-body: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --header-bg: #4f46e5;
    --header-text: #ffffff;
}

[data-bs-theme="dark"] {
    --bg-body: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --header-bg: #1e293b;
    --header-text: #f8fafc;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1.5rem 1rem;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
}

[data-bs-theme="dark"] .app-header {
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Theme Toggle Fab */
.theme-fab {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 20;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.theme-fab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Cards */
.card-custom {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-custom:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Type Selector */
.type-selector-scroll {
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
     /* Hide scrollbar for Chrome/Safari/Opera */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.type-selector-scroll::-webkit-scrollbar {
    display: none;
}

.type-btn {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem !important;
    white-space: nowrap;
    transition: all 0.2s;
}

.type-btn:hover {
    background-color: rgba(79, 70, 229, 0.05);
    color: var(--accent-color);
}

.btn-check:checked + .type-btn {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--accent-color);
    font-weight: 600;
}

.material-icons-round {
    font-size: 1.25rem;
}

/* Inputs */
.input-group-custom textarea, 
.input-group-custom input, .input-group-custom select {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0.5rem;
}

.input-group-custom textarea:focus, 
.input-group-custom input:focus, .input-group-custom select:focus {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Accordion Customization */
.accordion-button {
    color: var(--text-main);
    font-weight: 500;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--accent-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.accordion-item {
    border-color: var(--border-color);
}

/* Color Input */
.form-control-color {
    width: 3rem;
    height: 3rem;
    padding: 0.25rem;
    border-radius: 50%;
    cursor: pointer;
}

/* Preview Area */
.qr-preview-container {
    width: 280px;
    height: 280px;
    background-color: #ffffff; /* Checkboard usually, but standard is white for saving context */
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 2px dashed var(--border-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Helper for d-none transitions if needed, but d-none is instant */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-primary:hover {
    background-color: var(--accent-color);
    color: white;
}
