/* ===================================
   Watermarker - Watermark App Styles
   Side-by-side layout with live preview
   =================================== */

/* === Hero Section === */
.hero-section {
    background: var(--gradient-hero);
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
}

.hero-section.compact {
    padding: var(--spacing-lg) var(--spacing-lg);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* === App Container - Wide Layout === */
.watermark-app {
    padding: var(--spacing-lg);
}

.app-container-wide {
    max-width: 1400px;
    margin: 0 auto;
}

/* === Two Column Layout === */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.right-panel {
    position: relative;
}

/* === Upload Section - Compact === */
.upload-section.compact {
    margin-bottom: 0;
}

.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    margin-bottom: var(--spacing-sm);
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.upload-area h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: var(--spacing-md);
}

/* === File List === */
.file-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.file-list-header h4 {
    margin: 0;
    font-size: 0.9rem;
}

.files {
    max-height: 120px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    font-size: 0.85rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    overflow: hidden;
}

.file-icon {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.file-details {
    overflow: hidden;
}

.file-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.file-size {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.file-remove:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.file-remove svg {
    width: 14px;
    height: 14px;
}

/* === Settings Section - Compact === */
.settings-section.compact {
    margin-bottom: 0;
}

/* === Mode Selector - Compact === */
.mode-selector.compact {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.mode-selector.compact .mode-option {
    flex: 1;
}

.mode-selector.compact .mode-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
}

.mode-selector.compact .mode-option input:checked + .mode-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.mode-icon-small {
    font-size: 1.1rem;
}

/* === Settings Group - Compact === */
.settings-group.compact {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.settings-group.compact h3 {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

/* === Form Elements - Compact === */
.form-row.compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-row.compact:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-sm);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label, .form-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
    margin-top: 4px;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

/* === Size Slider === */
.size-slider {
    width: 100%;
    margin-top: var(--spacing-xs);
}

/* === Color Input === */
.color-input-wrapper {
    display: flex;
    gap: var(--spacing-xs);
}

.color-input-wrapper input[type="color"] {
    width: 36px;
    height: 30px;
    padding: 2px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
}

/* === Position Grid - Compact === */
.position-grid.compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: var(--spacing-sm);
}

.position-option input {
    display: none;
}

.position-label {
    display: block;
    text-align: center;
    padding: 4px 6px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.position-option input:checked + .position-label {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.position-label:hover {
    border-color: var(--primary-light);
}

/* Custom position button - distinct styling */
.position-label-custom {
    background: var(--bg-tertiary);
    border: 2px dashed var(--warning, #f59e0b);
    color: var(--warning, #f59e0b);
    font-weight: 500;
}

.position-label-custom:hover {
    border-color: var(--warning, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
}

.position-option input:checked + .position-label-custom {
    border-style: solid;
    border-color: var(--warning, #f59e0b);
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning, #f59e0b);
}

.custom-position {
    background: var(--bg-tertiary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

/* === Preview Section - Sticky === */
.preview-section.sticky {
    position: sticky;
    top: 80px;
}

.preview-section h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.preview-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder svg {
    width: 60px;
    height: 60px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: 0.9rem;
}

#previewCanvas {
    max-width: 100%;
    max-height: 350px;
    border-radius: var(--radius-sm);
}

/* === Submit Section === */
.submit-section {
    margin-top: var(--spacing-md);
}

.submit-section .btn {
    width: 100%;
}

/* === Results Section - In Preview Panel === */
.results-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.results-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-summary {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.results-summary .success-count {
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: 700;
}

.results-summary p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.download-buttons .btn {
    width: 100%;
    justify-content: center;
}

.individual-downloads {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.individual-downloads h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 150px;
    overflow-y: auto;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.download-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* === WaterMarker HQ Section === */
.hq-section {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.hq-container {
    max-width: 1000px;
    margin: 0 auto;
}

.hq-section h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hq-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-md);
}

.hq-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-sm);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: white;
    transition: all var(--transition-fast);
    aspect-ratio: 1;
    min-height: 100px;
}

.hq-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tile-icon {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.tile-icon svg {
    width: 32px;
    height: 32px;
}

.tile-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Discord gradient */
.discord-tile {
    background: linear-gradient(135deg, #5865F2 0%, #7289DA 100%);
}

/* YouTube gradient */
.youtube-tile {
    background: linear-gradient(135deg, #FF0000 0%, #8B0000 100%);
}

/* Instagram gradient */
.instagram-tile {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Donate gradient */
.donate-tile {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

/* Website gradient */
.website-tile {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* More Apps gradient */
.apps-tile {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .right-panel {
        order: -1;
    }
    
    .preview-section.sticky {
        position: relative;
        top: 0;
    }
    
    .preview-container {
        min-height: 250px;
    }
    
    #previewCanvas {
        max-height: 250px;
    }
    
    .hq-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hq-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row.compact {
        grid-template-columns: 1fr;
    }
    
    .position-grid.compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}
