/* style.css - Premium styling for Chapterwise Test Paper Generator */

:root {
    /* Color Palette - Customized for Edgar & Ollie Press */
    --primary: #2567af;       /* Brand Royal Blue */
    --primary-hover: #1b5391;
    --primary-light: #e9f2fc;
    --accent: #20afde;        /* Brand Sky Blue */
    --accent-light: #e8f7fd;
    --success: #10b981;       /* Emerald Green */
    --success-light: #ecfdf5;
    --danger: #ef4444;        /* Crimson Red */
    --danger-light: #fef2f2;
    --bg-app: #f1f5f9;        /* Soft Slate */
    --bg-sidebar: #ffffff;
    --bg-paper: #ffffff;
    --text-main: #2b2a29;     /* Charcoal Dark */
    --text-muted: #64748b;    /* Light Slate */
    --border: #e2e8f0;
    
    /* Layout Tokens */
    --sidebar-width: 360px;
    --header-height: 70px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 20px 25px -5px rgb(79 70 229 / 0.1), 0 8px 10px -6px rgb(79 70 229 / 0.05);
    --radius: 12px;
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-app);
    height: 100vh;
    overflow: hidden;
}

/* App Layout Grid */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.brand-icon {
    font-size: 28px;
    margin-right: 14px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.brand-text span {
    font-size: 11px;
    opacity: 0.85;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Custom Scrollbar for Sidebar */
.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Accordion sections */
.accordion-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.accordion-section.active {
    box-shadow: var(--shadow-md);
}

.accordion-header {
    padding: 14px 18px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    background-color: #f8fafc;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-main);
    transition: background-color 0.2s;
}

.accordion-section.active .accordion-header {
    border-bottom: 1px solid var(--border);
    background-color: #ffffff;
    color: var(--primary);
}

.accordion-header i {
    margin-right: 10px;
    font-size: 16px;
    color: var(--text-muted);
}

.accordion-section.active .accordion-header i {
    color: var(--primary);
}

.accordion-content {
    padding: 18px;
    display: none;
}

.accordion-section.active .accordion-content {
    display: block;
}

/* Inputs & Form Styling */
.input-group {
    margin-bottom: 14px;
}

.input-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
    background-color: #f8fafc;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 103, 175, 0.12);
}

.row-inputs {
    display: flex;
    gap: 12px;
}

.row-inputs .input-group {
    flex: 1;
}

/* Tab buttons for Mode */
.tab-container {
    display: flex;
    background-color: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn.active {
    background-color: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.mode-info {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 2px 4px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 103, 175, 0.2), 0 2px 4px -2px rgba(37, 103, 175, 0.2);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(37, 103, 175, 0.35), 0 3px 6px -3px rgba(37, 103, 175, 0.2);
    opacity: 0.95;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.btn-small:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-small.btn-secondary {
    border-color: var(--border);
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.btn-small.btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.action-container {
    margin-top: 8px;
    margin-bottom: 12px;
}

/* Chapter List checkboxes */
.chapter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 12px;
}

.chapter-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background-color: #f8fafc;
}

.chapter-item {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 13px;
    font-weight: 500;
}

.chapter-item:hover {
    background-color: #e2e8f0;
}

.chapter-item.selected {
    background-color: var(--primary-light);
    color: var(--primary);
}

.chapter-item input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Custom Number Spinners for Manual Q count */
.question-type-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.question-type-row:last-of-type {
    border-bottom: none;
}

.type-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.spinner-container {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.spin-btn {
    border: none;
    background-color: #f1f5f9;
    color: var(--text-main);
    width: 28px;
    height: 28px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.q-count {
    border: none !important;
    background: transparent !important;
    width: 36px !important;
    height: 28px !important;
    text-align: center !important;
    padding: 0 !important;
    font-weight: 600;
    -moz-appearance: textfield;
}

.q-count::-webkit-outer-spin-button,
.q-count::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-marks-badge {
    margin-top: 14px;
    background-color: var(--accent-light);
    border: 1px dashed var(--accent);
    color: var(--accent);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
}

/* Main Area Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Top Toolbar */
.toolbar {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    box-shadow: var(--shadow-sm);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cbd5e1;
    margin-right: 10px;
    display: inline-block;
}

.status-indicator.active {
    background-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.status-indicator.working {
    background-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    animation: pulse 1.5s infinite;
}

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

.toolbar-title {
    display: flex;
    align-items: center;
}

.toolbar-title h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.toolbar-actions {
    display: flex;
    gap: 12px;
}

.btn-action {
    background-color: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

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

.btn-action i {
    color: var(--text-muted);
}

.btn-action.active-toggle {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-action.active-toggle i {
    color: var(--primary);
}

/* Paper Viewport / desk representation */
.paper-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    background-color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Welcome Banner */
.welcome-banner {
    background-color: #ffffff;
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-top: 40px;
}

.welcome-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
    opacity: 0.9;
}

.welcome-banner h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.welcome-banner p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* The Paper Sheet */
.paper-sheet {
    background-color: var(--bg-paper);
    width: 800px;
    min-height: 1130px; /* A4 aspect ratio approximation */
    padding: 60px 70px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    color: #1a1a1a;
    font-family: 'Times New Roman', Times, serif; /* Traditional exam paper font */
    font-size: 15px;
    line-height: 1.5;
}

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

.editable-header {
    border: 1px solid transparent;
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
}

.editable-header:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    cursor: text;
}

.editable-header:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 103, 175, 0.08);
}

.paper-header h2 {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.paper-header h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 16px;
}

.paper-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1.5px solid #000000;
    border-bottom: 1.5px solid #000000;
    padding: 8px 0;
    font-size: 14px;
    margin-bottom: 16px;
}

.paper-meta-grid div span {
    border-bottom: 1px dotted transparent;
    padding: 1px 4px;
}

.paper-meta-grid div span:hover {
    border-bottom-color: #94a3b8;
    background-color: #f8fafc;
}

.student-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: bold;
}

.paper-instructions {
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.paper-instructions h4 {
    font-weight: bold;
    margin-bottom: 4px;
    text-decoration: underline;
}

.paper-instructions ol {
    padding-left: 20px;
}

.header-divider {
    border: 0;
    border-top: 2px solid #000000;
    margin-bottom: 24px;
}

.text-right {
    text-align: right;
}

/* Sections & Questions */
.paper-section {
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.section-title {
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #000000;
    padding-bottom: 4px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.question-item {
    position: relative;
    padding: 8px 8px 8px 24px;
    border-radius: 6px;
    transition: background-color 0.2s;
    page-break-inside: avoid;
}

.question-item:hover {
    background-color: #f8fafc;
}

.question-num {
    position: absolute;
    left: 0;
    top: 8px;
    font-weight: bold;
}

.question-content {
    outline: none;
    min-height: 24px;
}

.question-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.question-text {
    flex: 1;
    padding-right: 20px;
}

.question-marks {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

/* MCQ Options grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 30px;
    margin-top: 8px;
    padding-left: 4px;
}

.option-item {
    display: flex;
    gap: 8px;
}

.option-letter {
    font-weight: bold;
}

.option-text {
    flex: 1;
    border-bottom: 1px dotted transparent;
}

.option-text:hover {
    background-color: #f1f5f9;
    border-bottom-color: #cbd5e1;
}

/* Answers style */
.answer-block {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #f0fdf4; /* Light green highlight on screen */
    border-left: 3px solid #22c55e;
    font-size: 13px;
    color: #15803d;
    font-family: var(--font-body);
    border-radius: 0 4px 4px 0;
    display: none;
}

.answer-block strong {
    color: #166534;
}

/* Question Action Toolbar (on hover) */
.question-toolbar {
    position: absolute;
    right: 8px;
    top: -20px;
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 3px 8px;
    display: flex;
    gap: 4px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.2s, top 0.2s;
    z-index: 100;
}

.question-item:hover .question-toolbar {
    opacity: 1;
    top: -15px;
}

.tool-btn {
    border: none;
    background: transparent;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.tool-btn.btn-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-card {
    background-color: #ffffff;
    padding: 35px;
    border-radius: 16px;
    width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    border: 1px solid var(--border);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.math-spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.spinner-circle {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border: 4px solid #f1f5f9;
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.math-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: var(--primary);
}

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

.loading-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.loading-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.progress-bar {
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 3px;
    width: 15%;
    transition: width 0.4s ease-out;
}

.loading-step {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}

.toast {
    background-color: #ffffff;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 14px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-left-color: var(--success);
}
.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}
.toast.error i {
    color: var(--danger);
}

.toast i {
    font-size: 16px;
    color: var(--primary);
}

/* Print CSS Stylesheet override */
@media print {
    .no-print,
    .no-print * {
        display: none !important;
    }
    
    body {
        background-color: #ffffff !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .app-container {
        display: block !important;
        height: auto !important;
        width: auto !important;
    }
    
    .main-content {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .paper-viewport {
        background-color: #ffffff !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }
    
    .paper-sheet {
        box-shadow: none !important;
        width: 100% !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 14pt !important;
        color: #000000 !important;
    }
    
    .question-item {
        padding-left: 20pt !important;
        padding-top: 4pt !important;
        padding-bottom: 4pt !important;
        border-radius: 0 !important;
        transition: none !important;
    }
    
    .question-item:hover {
        background-color: transparent !important;
    }
    
    .question-toolbar {
        display: none !important;
    }
    
    .option-text:hover {
        background-color: transparent !important;
        border-bottom-color: transparent !important;
    }
    
    /* Toggle answers styling in print */
    .answer-block {
        margin-top: 5pt !important;
        padding: 6pt 10pt !important;
        border-left: 2pt solid #000000 !important;
        background-color: #f5f5f5 !important;
        font-size: 11pt !important;
        color: #000000 !important;
    }

    /* Print answers only if body has class "print-answers" */
    body:not(.print-answers) .answer-block {
        display: none !important;
    }
    
    body.print-answers .answer-block {
        display: block !important;
    }
}

/* QR Manager styles */
.qr-record-row {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.qr-record-row:last-child {
    margin-bottom: 0;
}

.qr-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qr-input-row input {
    padding: 6px 10px;
    font-size: 12px;
}

.qr-record-key {
    width: 35%;
    font-weight: 700;
}

.qr-record-url {
    width: 65%;
}

.qr-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.qr-mini-btn {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    border: 1px solid var(--border);
    background-color: #ffffff;
    color: var(--text-main);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qr-mini-btn:hover {
    background-color: #f1f5f9;
}

.qr-mini-btn.btn-save {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.qr-mini-btn.btn-save:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.qr-mini-btn.btn-delete {
    background-color: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.qr-mini-btn.btn-delete:hover {
    background-color: var(--danger);
    color: #ffffff;
}

/* Modal for displaying QR code image */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.qr-modal-card {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    width: 320px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
}

.qr-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
}

.qr-modal-img {
    width: 200px;
    height: 200px;
    margin: 15px auto;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.qr-modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.qr-modal-desc {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 15px;
}
