/**
 * New Features Styles
 * Blueprint, Smart Render, Video
 */

/* ==========================================
   MODALES
   ========================================== */

.iai-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.iai-modal.active {
    display: flex;
}

.iai-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.iai-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.iai-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.iai-modal-close:hover {
    background: #e8e8e8;
    color: #333;
    transform: rotate(90deg);
}

.iai-modal-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.iai-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.iai-modal-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

.iai-modal-body {
    padding: 32px;
}

.iai-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==========================================
   SECTIONS HEADERS
   ========================================== */

.iai-section-header {
    margin-bottom: 32px;
}

.iai-section-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.iai-section-description {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.iai-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.iai-empty-icon {
    width: 64px;
    height: 64px;
    color: #ddd;
    margin-bottom: 24px;
}

.iai-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.iai-empty-state p {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px 0;
    max-width: 400px;
}

/* ==========================================
   BUTTONS
   ========================================== */

.iai-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.iai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.iai-btn-primary svg {
    width: 20px;
    height: 20px;
}

.iai-btn-secondary {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-btn-secondary:hover {
    background: #e8e8e8;
}

/* ==========================================
   MODAL LARGE
   ========================================== */

.iai-modal-large {
    max-width: 800px;
    width: 90%;
}

/* ==========================================
   UPLOAD ZONES
   ========================================== */

.iai-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border: 2px dashed #ddd;
    border-radius: 16px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.iai-upload-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.iai-upload-zone.dragover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: scale(1.02);
}

.iai-upload-zone svg {
    width: 48px;
    height: 48px;
    color: #999;
    margin-bottom: 16px;
}

.iai-upload-zone p {
    margin: 0;
    font-size: 15px;
    color: #333;
}

.iai-upload-zone p strong {
    color: #667eea;
}

.iai-upload-hint {
    font-size: 13px !important;
    color: #999 !important;
    margin-top: 8px !important;
}

/* ==========================================
   FORM GROUPS
   ========================================== */

.iai-form-group {
    margin-bottom: 24px;
}

.iai-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.iai-form-group textarea,
.iai-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.iai-form-group textarea:focus,
.iai-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.iai-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================
   BLUEPRINT SPECIFIC
   ========================================== */

.iai-blueprint-container,
.iai-smartrender-container,
.iai-video-container {
    padding: 20px;
}

.iai-blueprint-preview {
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
}

.iai-blueprint-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.iai-blueprint-options {
    padding: 24px;
    background: #fafafa;
    border-radius: 16px;
    margin-bottom: 24px;
}

.iai-blueprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px;
}

.iai-blueprint-result {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.iai-blueprint-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.iai-blueprint-result-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.iai-blueprint-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iai-blueprint-result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iai-blueprint-result:hover .iai-blueprint-result-overlay {
    opacity: 1;
}

.iai-blueprint-result-action {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-blueprint-result-action:hover {
    transform: scale(1.1);
    background: #667eea;
}

.iai-blueprint-result-action:hover svg {
    color: white;
}

.iai-blueprint-result-action svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.iai-blueprint-result-info {
    padding: 16px;
}

.iai-blueprint-result-viewpoint {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
    text-transform: capitalize;
}

.iai-blueprint-result-date {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ==========================================
   SMART RENDER SPECIFIC
   ========================================== */

.iai-smartrender-preview-grid,
.iai-video-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.iai-smartrender-preview-item,
.iai-video-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.iai-smartrender-preview-item img,
.iai-video-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iai-smartrender-preview-remove,
.iai-video-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.iai-smartrender-preview-remove:hover,
.iai-video-preview-remove:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.iai-video-preview-order {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.iai-smartrender-presets {
    margin-bottom: 24px;
}

.iai-smartrender-presets label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 16px;
}

.iai-preset-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.iai-preset-card {
    padding: 24px;
    background: #fafafa;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.iai-preset-card:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.iai-preset-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.iai-preset-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.iai-preset-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.iai-preset-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.iai-smartrender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px;
}

.iai-smartrender-result {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.iai-smartrender-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.iai-smartrender-result-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.iai-smartrender-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iai-smartrender-result-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.iai-smartrender-result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iai-smartrender-result:hover .iai-smartrender-result-overlay {
    opacity: 1;
}

.iai-smartrender-result-action {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-smartrender-result-action:hover {
    transform: scale(1.1);
    background: #667eea;
}

.iai-smartrender-result-action:hover svg {
    color: white;
}

.iai-smartrender-result-action svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.iai-smartrender-result-info {
    padding: 16px;
}

.iai-smartrender-result-date {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ==========================================
   VIDEO SPECIFIC
   ========================================== */

.iai-video-options {
    padding: 24px;
    background: #fafafa;
    border-radius: 16px;
    margin-bottom: 24px;
}

.iai-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.iai-range-labels span {
    font-size: 12px;
    color: #999;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
}

.iai-ratio-buttons {
    display: flex;
    gap: 12px;
}

.iai-ratio-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-ratio-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.iai-ratio-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    color: #667eea;
}

.iai-ratio-btn svg {
    width: 32px;
    height: 32px;
}

.iai-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px;
}

.iai-video-result {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.iai-video-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.iai-video-result-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
}

.iai-video-result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iai-video-result-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.iai-video-result-thumbnail:hover .iai-video-result-play {
    transform: translate(-50%, -50%) scale(1.1);
}

.iai-video-result-play svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.iai-video-result-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.iai-video-result-info {
    padding: 16px;
}

.iai-video-result-style {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
}

.iai-video-result-date {
    font-size: 13px;
    color: #999;
    margin: 0;
}

.iai-video-result-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.iai-video-result-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-video-result-action:hover {
    background: #667eea;
    color: white;
}

.iai-video-result-action svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .iai-preset-cards {
        grid-template-columns: 1fr;
    }

    .iai-blueprint-grid,
    .iai-smartrender-grid,
    .iai-video-grid {
        grid-template-columns: 1fr;
    }

    .iai-modal-large {
        width: 95%;
    }

    .iai-ratio-buttons {
        flex-direction: column;
    }
}
