/**
 * Photobook Creator Styles
 * 
 * Responsive CSS for the photobook creation interface
 */

/* Modal and Wizard Styles */
#photobook-wizard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#photobook-wizard .wizard-container {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#photobook-wizard .wizard-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    position: relative;
}

#photobook-wizard .wizard-header h2 {
    margin: 0 0 16px 0;
    color: #111827;
    font-size: 24px;
    font-weight: 600;
}

#photobook-wizard .close-wizard {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#photobook-wizard .close-wizard:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Step Indicator */
#photobook-wizard .step-indicator {
    display: flex;
    gap: 12px;
}

#photobook-wizard .step {
    padding: 8px 16px;
    border-radius: 20px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

#photobook-wizard .step.active {
    background: #3b82f6;
    color: white;
}

#photobook-wizard .step.completed {
    background: #10b981;
    color: white;
}

/* Wizard Content */
#photobook-wizard .wizard-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

#photobook-wizard .wizard-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    background: #f9fafb;
}

/* Template Selection */
#photobook-wizard .template-selection h3 {
    margin: 0 0 24px 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

#photobook-wizard .template-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    #photobook-wizard .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

#photobook-wizard .template-option {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#photobook-wizard .template-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

#photobook-wizard .template-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#photobook-wizard .template-preview {
    width: 100%;
    height: 120px;
    background: #f3f4f6;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

#photobook-wizard .template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#photobook-wizard .template-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    gap: 8px;
}

#photobook-wizard .template-placeholder i {
    color: #9ca3af;
}

#photobook-wizard .template-placeholder div {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#photobook-wizard .template-option h4 {
    margin: 0 0 8px 0;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
}

#photobook-wizard .template-option p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

/* Content Selection */
#photobook-wizard .content-selection h3 {
    margin: 0 0 16px 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

#photobook-wizard .selection-summary {
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
}

#photobook-wizard .mapory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

#photobook-wizard .mapory-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

#photobook-wizard .mapory-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

#photobook-wizard .mapory-item input:checked + .mapory-item,
#photobook-wizard .mapory-item:has(input:checked) {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#photobook-wizard .mapory-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

#photobook-wizard .mapory-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#photobook-wizard .mapory-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

#photobook-wizard .mapory-info {
    padding: 12px;
    background: white;
}

#photobook-wizard .mapory-info h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

#photobook-wizard .mapory-meta {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

#photobook-wizard .mapory-meta .mapory-landmark {
    color: #1f2937;
    font-weight: 600;
}

#photobook-wizard .mapory-meta .mapory-country {
    color: #374151;
    font-weight: 500;
}

/* Customization Form */
#photobook-wizard .photobook-customization h3 {
    margin: 0 0 24px 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

#photobook-wizard .customization-form {
    max-width: 500px;
}

#photobook-wizard .form-group {
    margin-bottom: 24px;
}

#photobook-wizard .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

#photobook-wizard .form-group input[type="text"],
#photobook-wizard .form-group textarea,
#photobook-wizard .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

#photobook-wizard .form-group input[type="text"]:focus,
#photobook-wizard .form-group textarea:focus,
#photobook-wizard .form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#photobook-wizard .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#photobook-wizard .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

#photobook-wizard .checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

#photobook-wizard .checkbox-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Preview */
#photobook-wizard .photobook-preview h3 {
    margin: 0 0 24px 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

#photobook-wizard .preview-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 6px;
}

.summary-stat {
    font-size: 14px;
    color: #374151;
}

.summary-stat strong {
    color: #111827;
}

.preview-container {
    text-align: center;
}

.page-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.page-thumbnail {
    aspect-ratio: 1;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.page-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Progress */
.creation-progress {
    text-align: center;
    padding: 40px 20px;
}

.creation-progress h3 {
    margin: 0 0 24px 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#photobook-wizard #status-text {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Buttons */
#photobook-wizard .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

#photobook-wizard .btn-primary {
    background: #3b82f6;
    color: white;
}

#photobook-wizard .btn-primary:hover {
    background: #2563eb;
}

#photobook-wizard .btn-secondary {
    background: #6b7280;
    color: white;
}

#photobook-wizard .btn-secondary:hover {
    background: #4b5563;
}

#photobook-wizard .btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

#photobook-wizard .btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#photobook-wizard .btn-success {
    background: #10b981;
    color: white;
}

#photobook-wizard .btn-success:hover {
    background: #059669;
}

/* Integration with existing UI */
.trip-photobook-section {
    margin-top: 24px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.trip-photobook-section h3 {
    margin: 0 0 8px 0;
    color: #1a202c;
    font-size: 18px;
    font-weight: 600;
}

.trip-photobook-section p {
    margin: 0 0 16px 0;
    color: #4a5568;
    font-size: 14px;
}

.dashboard-section.photobooks {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 20px;
    font-weight: 600;
}

.photobook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Responsive Design */
@media (max-width: 640px) {
    #photobook-wizard .wizard-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    #photobook-wizard .wizard-header {
        padding: 16px;
    }
    
    #photobook-wizard .wizard-content {
        padding: 16px;
    }
    
    #photobook-wizard .step-indicator {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #photobook-wizard .step {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #photobook-wizard .template-grid {
        grid-template-columns: 1fr;
    }
    
    #photobook-wizard .mapory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    #photobook-wizard .preview-summary {
        flex-direction: column;
        gap: 8px;
    }
    
    #photobook-wizard .preview-actions {
        flex-direction: column;
    }
}

/* Loading States */
#photobook-wizard .loading {
    position: relative;
    pointer-events: none;
}

#photobook-wizard .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
#photobook-wizard .error-message {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Success States */
#photobook-wizard .success-message {
    padding: 12px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #065f46;
    font-size: 14px;
    margin-bottom: 16px;
}
