/**
 * FezaFilm Creative Tools - Component Styles
 * Buttons, Cards, Forms, Modals, etc.
 */

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

/* Primary Button - Gold */
.btn-primary {
    background: var(--color-gold);
    color: var(--color-text-inverse);
    border-color: var(--color-gold);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-gold-light);
    border-color: var(--color-gold-light);
    box-shadow: var(--shadow-gold);
}

/* Secondary Button - Red */
.btn-secondary {
    background: var(--color-red);
    color: var(--color-text-primary);
    border-color: var(--color-red);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-red-light);
    border-color: var(--color-red-light);
    box-shadow: var(--shadow-red);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-gold-muted);
}

.btn-outline-red {
    background: transparent;
    color: var(--color-red);
    border-color: var(--color-red);
}

.btn-outline-red:hover:not(:disabled) {
    background: var(--color-red-muted);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* Icon Button */
.btn-icon {
    padding: var(--space-2);
    border-radius: var(--radius-md);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--color-border-light);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

/* Feature Card (Dashboard) */
.feature-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.feature-card:hover {
    border-color: var(--color-gold);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: var(--color-gold-muted);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    transition: all var(--transition-base);
}

.feature-card:hover .feature-icon {
    background: var(--color-gold);
    transform: scale(1.1);
}

.feature-card:hover .feature-icon span {
    filter: grayscale(1) brightness(0);
}

.feature-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.feature-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px var(--color-gold-muted);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: var(--space-10);
}

/* File Input */
.form-file {
    position: relative;
    overflow: hidden;
}

.form-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ============================================
   DROP ZONE
   ============================================ */
.drop-zone {
    position: relative;
    padding: var(--space-12) var(--space-6);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--color-gold);
    background: var(--color-gold-muted);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    transition: all var(--transition-base);
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.dragover .drop-zone-icon {
    background: var(--color-gold);
    transform: scale(1.1);
}

.drop-zone-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.drop-zone-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ============================================
   ACCORDION / COLLAPSIBLE
   ============================================ */
.accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--color-border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.accordion-header:hover {
    background: var(--color-bg-tertiary);
}

.accordion-header.active {
    color: var(--color-gold);
}

.accordion-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.accordion-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.accordion-header.active .accordion-dot {
    background: var(--color-gold);
    box-shadow: 0 0 8px var(--color-gold);
}

.accordion-arrow {
    transition: transform var(--transition-fast);
}

.accordion-header.active .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: var(--space-5);
    background: var(--color-bg-tertiary);
    border-top: 1px solid var(--color-border);
}

.accordion-content.open {
    display: block;
    animation: slideDown var(--transition-fast);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
}

.modal {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Large Modal */
.modal-lg {
    max-width: 900px;
}

.modal-xl {
    max-width: 1200px;
    height: 90vh;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform var(--transition-base);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(74, 222, 128, 0.2);
    color: var(--color-success);
}

.toast-error .toast-icon {
    background: var(--color-red-muted);
    color: var(--color-red);
}

.toast-warning .toast-icon {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning);
}

.toast-info .toast-icon {
    background: rgba(96, 165, 250, 0.2);
    color: var(--color-info);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 11, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    z-index: 50;
    border-radius: inherit;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-1);
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--color-text-secondary);
}

.tab.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

.tab-content {
    display: none;
    padding: var(--space-6) 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-fast);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-gold {
    background: var(--color-gold-muted);
    color: var(--color-gold);
}

.badge-red {
    background: var(--color-red-muted);
    color: var(--color-red);
}

.badge-success {
    background: rgba(74, 222, 128, 0.2);
    color: var(--color-success);
}

.badge-info {
    background: rgba(96, 165, 250, 0.2);
    color: var(--color-info);
}

/* ============================================
   PROGRESS
   ============================================ */
.progress {
    width: 100%;
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--color-gold);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.progress-bar-red {
    background: var(--color-red);
}

/* ============================================
   COMPARISON SLIDER
   ============================================ */
.comparison-slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
    user-select: none;
}

.comparison-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.comparison-before {
    z-index: 1;
}

.comparison-after {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.comparison-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--color-gold);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.comparison-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--color-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
}

.comparison-label {
    position: absolute;
    top: var(--space-3);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-text-primary);
    border-radius: var(--radius-sm);
    z-index: 5;
}

.comparison-label-before {
    left: var(--space-3);
}

.comparison-label-after {
    right: var(--space-3);
    background: var(--color-gold);
    color: var(--color-text-inverse);
}

/* ============================================
   IMAGE PREVIEW
   ============================================ */
.image-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-tertiary);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.image-preview:hover .image-preview-overlay {
    opacity: 1;
}

/* ============================================
   SHOT CARD
   ============================================ */
.shot-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.shot-card-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shot-number {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-gold);
}

.shot-card-body {
    padding: var(--space-4);
}

.shot-refs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.shot-ref {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--color-bg-tertiary);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.shot-ref:hover {
    border-color: var(--color-gold);
}

.shot-ref img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shot-ref-remove {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 24px;
    height: 24px;
    background: var(--color-red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: var(--text-sm);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.shot-ref:hover .shot-ref-remove {
    opacity: 1;
}

