﻿/* ==================================================
   QR CODE GENERATOR MODAL STYLES - Cover Page Specific
   ==================================================

   This file contains SPECIFIC styles for the QR Code Generator Modal
   (#qrModal) used on the cover page. It inherits base modal styles from
   ../shared/modals.css and adds QR Code Generator specific functionality.

   IMPORTANT: This file works WITH modals.css, not instead of it!

   Features:
   - Step-by-step QR code creation
   - Multiple QR code types (Website, PDF, Custom)
   - QR code preview and management
   - URL configuration interface
   - Existing QR codes management

   Last Updated: [Current Date]
   ================================================== */

/* ==================================================
   1. QR MODAL Z-INDEX (Required for proper layering)
   ================================================== */

#qrModal {
    z-index: 10000 !important;
}

#qrModal .modal-dialog {
    z-index: 10000 !important;
    max-width: 650px;
}

#qrModal .modal-content {
    z-index: 10000 !important;
}

/* ==================================================
   2. QR MODAL LAYOUT & STRUCTURE
   ================================================== */

/* QR Modal Content - Wider for better layout */
.qr-modal-content {
    max-width: 750px;
    margin: 0 auto;
}

/* QR Modal Header with Progress */
.qr-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 12px 4px;
    border-bottom: none;
    position: relative;
    z-index: 1000;
}

.qr-modal-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.qr-modal-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-modal-header .header-icon {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 14px;
    color: white;
}

.qr-modal-header .title-main {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: block;
}

.qr-modal-header .title-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
}

/* ==================================================
   3. PROGRESS BAR - Step Indicator
   ================================================== */

/* Progress Bar Container */
.progress-container {
    display: flex;
    align-items: center;
}

/* Progress Bar - Small Compact Design */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Individual Step */
.step {
    display: flex;
    align-items: center;
    gap: 3px;
    position: relative;
}

/* Step Number Circle */
.step-number {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Step Connector Line */
.step-connector {
    width: 8px;
    height: 1px;
    background: rgba(255,255,255,0.4);
    transition: all 0.3s ease;
}

.step:last-child .step-connector {
    display: none;
}

/* Active Step Styling */
.step.active .step-number {
    background: white;
    color: #667eea;
    border: 1px solid white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Completed Step Styling */
.step.completed .step-number {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    box-shadow: 0 0 0 1px rgba(40,167,69,0.3);
}

.step.active .step-connector,
.step.completed .step-connector {
    background: rgba(255,255,255,0.8);
    height: 2px;
}

/* Step Labels (hidden by default) */
.step-label {
    display: none;
}

.step.active .step-label {
    display: none;
}

/* ==================================================
   4. EXISTING QR CODES SECTION
   ================================================== */

/* Existing QR Codes Section */
.existing-qr-section {
    margin-bottom: 16px;
    padding: 14px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.existing-qr-header h6 {
    color: #28a745;
    margin-bottom: 5px;
    font-weight: 600;
}

.existing-qr-header p {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Existing QR List Grid */
.existing-qr-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

/* Individual QR Item */
.existing-qr-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.existing-qr-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* QR Item Info */
.existing-qr-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* QR Item Icon */
.existing-qr-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.existing-qr-icon.website-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.existing-qr-icon.pdf-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.existing-qr-icon.custom-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

/* QR Item Details */
.existing-qr-details h6 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.existing-qr-details p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
    word-break: break-all;
}

/* QR Item Remove Button */
.existing-qr-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.existing-qr-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ==================================================
   5. QR MODAL BODY
   ================================================== */

/* QR Modal Body */
.qr-modal-body {
    padding: 8px 12px;
    min-height: 220px;
    background: #ffffff;
    position: relative;
    z-index: 10;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

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

/* Step Header */
.step-header {
    text-align: center;
    margin-bottom: 4px;
}

.step-header h6 {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.step-header p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* ==================================================
   6. QR TYPE CARDS GRID
   ================================================== */

/* QR Types Grid */
.qr-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

/* QR Type Card */
.qr-type-card {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.qr-type-card:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.qr-type-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
    flex: 1;
}

/* Type Icon */
.type-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    margin-right: 8px;
}

.website-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.pdf-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.custom-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

/* Type Info */
.type-info {
    flex: 1;
}

.type-info h6 {
    margin: 0 0 3px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}

.type-info p {
    margin: 0;
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.2;
}

/* Type Toggle */
.type-toggle {
    position: absolute;
    bottom: -11px;
    right: 15px;
    z-index: 10;
}

/* ==================================================
   7. TOGGLE SWITCH
   ================================================== */

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: #ddd;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.qr-checkbox {
    display: none;
}

.qr-checkbox:checked + .toggle-switch {
    background-color: #667eea;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.qr-checkbox:checked + .toggle-switch::after {
    transform: translateX(18px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Card Preview */
.card-preview {
    color: #6c757d;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f1f3f4;
    line-height: 1.2;
}

/* ==================================================
   8. URL CONFIGURATION
   ================================================== */

/* URL Configuration Container */
.url-configuration {
    max-width: 500px;
    margin: 0 auto;
}

/* URL Config Section */
.url-config-section {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 4px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.url-config-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.url-config-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 0 3px 3px 0;
}

/* Config Header */
.config-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    padding-left: 2px;
}

/* Config Icon */
.config-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    margin-right: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.config-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* Enhanced config icons for URL configuration */
.url-config-section .config-icon.website-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.url-config-section .config-icon.pdf-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.url-config-section .config-icon.custom-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

/* Config Title */
.config-title h6 {
    margin: 0 0 1px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.config-title p {
    margin: 0;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

/* URL Input Group */
.url-input-group {
    margin-bottom: 4px;
    padding-left: 2px;
}

/* Input Label */
.input-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2px;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* QR Input Field */
.qr-input {
    border-radius: 4px;
    border: 2px solid #e9ecef;
    padding: 4px 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    width: 100%;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.qr-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), inset 0 2px 4px rgba(0,0,0,0.05);
    background: #ffffff;
    transform: translateY(-1px);
}

/* Input Help Text */
.input-help {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #667eea;
    margin-top: 2px;
    padding: 2px 4px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-radius: 3px;
    border-left: 2px solid #667eea;
    font-weight: 500;
}

/* ==================================================
   9. QR PREVIEW GRID
   ================================================== */

/* QR Preview Grid */
.qr-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* QR Preview Card */
.qr-preview-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.qr-preview-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Preview QR Container */
.preview-qr-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
    border: 2px solid #f1f3f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

.preview-qr-container .qr-code-preview {
    width: 80px;
    height: 80px;
}

.preview-qr-container .qr-code-preview canvas,
.preview-qr-container .qr-code-preview img {
    width: 100% !important;
    height: 100% !important;
}

/* QR Preview Card Content */
.qr-preview-card h6 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

.qr-preview-card p {
    margin: 0;
    font-size: 0.75rem;
    color: #6c757d;
    word-break: break-all;
    line-height: 1.2;
}

/* QR Remove Button */
.qr-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.qr-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Preview Info */
.preview-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6c757d;
    font-size: 0.85rem;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

/* ==================================================
   10. PREVIEW ACTIONS
   ================================================== */

/* Preview Actions */
.preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

/* ==================================================
   11. QR MODAL FOOTER
   ================================================== */

/* QR Modal Footer */
.qr-modal-footer {
    background: linear-gradient(135deg, #f8f9fb, #ffffff);
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
}

/* ==================================================
   12. RESPONSIVE DESIGN
   ================================================== */

/* Tablet responsiveness */
@media (max-width: 768px) {
    .qr-types-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .qr-type-card {
        min-height: auto;
        padding: 20px;
    }

    .type-toggle {
        bottom: -11px;
        right: 20px;
    }

    .progress-bar {
        gap: 4px;
        padding: 4px 8px;
    }

    .step-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .qr-modal-header .header-left {
        gap: 8px;
    }

    .step-connector {
        width: 10px;
    }

    .qr-modal-header {
        padding: 15px 20px 10px;
    }

    .toggle-switch {
        width: 46px;
        height: 24px;
    }

    .toggle-switch::after {
        width: 20px;
        height: 20px;
    }

    .qr-checkbox:checked + .toggle-switch::after {
        transform: translateX(22px);
    }

    .qr-modal-body {
        padding: 18px 20px;
        min-height: 320px;
    }

    .step-header {
        margin-bottom: 15px;
    }

    .step-header h6 {
        font-size: 1.1rem;
    }
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .qr-modal-body {
        padding: 15px 18px;
    }

    .qr-modal-header {
        padding: 12px 18px 10px;
    }

    .type-toggle {
        bottom: -11px;
        right: 25px;
    }

    .progress-container {
        gap: 6px;
    }

    .progress-bar {
        gap: 4px;
    }

    .step {
        gap: 3px;
    }

    .step-connector {
        width: 12px;
    }

    .qr-modal-header .header-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
        margin-right: 10px;
    }

    .qr-modal-header .title-main {
        font-size: 1.2rem;
    }

    .qr-modal-header .title-subtitle {
        font-size: 0.8rem;
    }

    .qr-preview-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .existing-qr-list {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   13. ACCESSIBILITY & FOCUS STATES
   ================================================== */

/* Enhanced focus states for accessibility */
.qr-type-card:focus,
.toggle-switch:focus,
.qr-input:focus,
.existing-qr-remove:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .qr-type-card,
    .url-config-section,
    .existing-qr-item {
        border-width: 2px;
    }

    .qr-type-card:hover,
    .url-config-section:hover {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .qr-type-card,
    .toggle-switch,
    .existing-qr-item,
    .qr-input,
    .form-step {
        transition: none;
        animation: none;
    }

    .qr-type-card:hover,
    .existing-qr-item:hover,
    .url-config-section:hover {
        transform: none;
    }

    @keyframes fadeInUp {
        from, to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==================================================
   ADDITIONAL UTILITY STYLES
   ================================================== */

/* Hidden buttons by default */
#clearAllQrBtn,
#prevQrStepBtn,
#generateQR {
    display: none;
}
