/* Advanced Features Styles */

/* Advanced Features Buttons */
.advanced-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.feature-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    padding: 0.875rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.feature-btn:active {
    transform: translateY(0);
}

.feature-btn i {
    font-size: 1.1rem;
}

/* Frame Options */
.frame-options,
.expiration-options {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-content.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light);
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--light);
    color: var(--dark);
    transform: rotate(90deg);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: var(--light);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.template-preview {
    width: 100%;
    height: 150px;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.template-preview img,
.template-preview canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.template-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.template-description {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Batch Generation */
.file-upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--light);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area.drag-over {
    border-color: var(--secondary-color);
    background: rgba(118, 75, 162, 0.05);
}

.file-upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.file-upload-area p {
    margin: 0.5rem 0;
    color: var(--dark);
    font-weight: 600;
}

.file-upload-area small {
    color: var(--gray);
}

.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
    color: var(--gray);
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--gray-light);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.batch-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.batch-options .form-group:last-child {
    grid-column: 1 / -1;
}

.batch-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

#batch-progress-text {
    text-align: center;
    color: var(--gray);
    font-weight: 600;
    margin: 0;
}

.batch-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.batch-qr-item {
    background: var(--light);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.batch-qr-item canvas {
    width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.batch-qr-item p {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Print Preview */
.print-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.print-options .form-group:last-child {
    grid-column: 1 / -1;
}

.print-preview {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.print-qr-copy {
    text-align: center;
    page-break-inside: avoid;
}

.print-qr-copy canvas {
    margin-bottom: 0.5rem;
}

.print-qr-copy p {
    font-size: 0.9rem;
    color: var(--dark);
    margin: 0;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10002;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast i {
    font-size: 1.5rem;
}

.toast.success i {
    color: #10b981;
}

.toast.error i {
    color: #ef4444;
}

.toast.info i {
    color: #3b82f6;
}

.toast-message {
    color: var(--dark);
    font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-content.modal-large {
        max-width: 95%;
    }
    
    .advanced-features {
        grid-template-columns: 1fr;
    }
    
    .batch-options,
    .print-options {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}
