/* Base Styles */
:root {
    --primary-color: #2D5BFF;
    --secondary-color: #00C2CB;
    --background-color: #F8F9FA;
    --text-color: #333333;
    --light-gray: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    color: white;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Layout */
header {
    padding: 1rem 2rem;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.settings-btn:hover {
    background-color: #f1f3f5;
}

/* URL Settings Modal */
.url-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.url-settings-modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--box-shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.url-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.url-form label {
    font-weight: 500;
}

.url-form input {
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: 'Roboto Mono', monospace;
}

.url-form .form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.url-form .save-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
}

.url-form .reset-btn {
    background-color: #f1f3f5;
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
}

/* Provider Options */
.provider-options {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.radio-option span {
    font-size: 0.95rem;
}

.form-group .hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.form-group .hint a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-group .hint a:hover {
    text-decoration: underline;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

section {
    margin-bottom: 2rem;
}

/* Hero Section */
.hero {
    background-image: url('https://images.unsplash.com/photo-1557426272-fc759fdf7a8d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Search Container */
.search-container {
    display: flex;
    background-color: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.search-input i {
    color: #666;
    margin-right: 0.5rem;
}

.search-input input {
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: 'Roboto Mono', monospace;
    width: 100%;
    padding: 0.75rem 0;
}

.generate-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-btn:hover {
    background-color: #1a46e0;
}

.generate-btn.disabled {
    background-color: #9eb3ff;
    cursor: not-allowed;
    opacity: 0.7;
}

.generate-btn.disabled:hover {
    background-color: #9eb3ff;
}

/* Customization Section */
.customization {
    padding: 1rem 0;
}

.options-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.option-group {
    flex: 1;
    min-width: 250px;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: 'Roboto Mono', monospace;
    background-color: white;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Theme Preview */
.theme-preview {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.theme-preview h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.theme-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.font-preview h5,
.color-palette h5 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-color);
}

.font-item {
    margin-bottom: 1rem;
}

.font-label {
    display: inline-block;
    font-weight: 500;
    margin-right: 1rem;
    min-width: 120px;
    color: #666;
}

.font-sample {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

#heading-font-preview {
    font-size: 1.1rem;
    font-weight: 600;
}

#body-font-preview {
    font-size: 0.95rem;
}

.color-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-label {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* Responsive adjustments for theme preview */
@media (max-width: 768px) {
    .theme-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .font-label {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .font-sample {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .color-grid {
        justify-content: space-around;
    }
    
    .color-item {
        flex: 0 0 calc(33.333% - 1rem);
        min-width: 80px;
    }
}

/* Custom Theme Integration */
.font-container {
    display: inline-block;
    width: 100%;
}

.font-select {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.font-select:hover {
    border-color: var(--primary-color);
}

.font-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(45, 91, 255, 0.1);
}

/* Clickable color swatches */
.color-swatch.clickable {
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch.clickable:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.color-swatch.clickable:active {
    transform: translateY(0) scale(0.98);
}

/* Position color inputs below their swatches */
.color-input {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    width: 1px;
    height: 1px;
    border: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Upload Section */
.upload-section {
    padding: 1rem 0;
}

.upload-container {
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background-color: white;
    transition: border-color 0.3s;
}

.upload-container.dragover {
    border-color: var(--primary-color);
    background-color: rgba(45, 91, 255, 0.05);
}

.browse-btn {
    background-color: #f1f3f5;
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.browse-btn:hover {
    background-color: #e9ecef;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item .file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-item .file-name i {
    color: var(--primary-color);
}

.file-item .remove-file {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1rem;
}

/* Model Section */
.model-section {
    padding: 1rem 0;
}

.model-selection {
    margin-bottom: 1rem;
}

#model-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: 'Roboto Mono', monospace;
    background-color: white;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.connection-status {
    font-size: 0.9rem;
}

#connection-status {
    font-weight: 600;
}

#connection-status.connected {
    color: var(--success-color);
}

#connection-status.disconnected {
    color: var(--error-color);
}

#connection-status.connecting {
    color: var(--warning-color);
}

/* Progress Section */
.progress-section {
    padding: 1rem 0;
}

.progress-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.progress-bar {
    height: 10px;
    background-color: var(--light-gray);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Result Section */
.result-section {
    padding: 1rem 0;
}

.result-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.presentation-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.slide-preview {
    width: 200px;
    height: 150px;
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--light-gray);
}

.slide-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slide-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide-content-preview {
    font-size: 0.8rem;
    color: #666;
    overflow: hidden;
    line-height: 1.4;
}

.item-count {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
}

.slide-number {
    position: absolute;
    bottom: 5px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

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

.download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background-color: #1a46e0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header adjustments */
    header {
        padding: 0.75rem 1rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        width: 3rem;
        height: 3rem;
    }
    
    /* Hero section */
    .hero {
        height: auto;
        min-height: 300px;
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Search container - stack vertically */
    .search-container {
        flex-direction: column;
        max-width: 100%;
        margin: 0;
    }
    
    .search-input {
        width: 100%;
        border-radius: 30px 30px 0 0;
    }
    
    .search-input input {
        padding: 1rem 0;
        font-size: 0.95rem;
    }
    
    .generate-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0 0 30px 30px;
        min-height: 48px; /* Better touch target */
    }
    
    /* Main content */
    main {
        padding: 0.5rem;
    }
    
    /* Sections */
    section {
        margin-bottom: 1.5rem;
    }
    
    .customization,
    .upload-section,
    .model-section,
    .image-layouts-section,
    .logo-settings-section {
        padding: 0.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    /* Options row */
    .options-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .option-group {
        min-width: 100%;
    }
    
    .option-group select {
        font-size: 1rem;
        padding: 0.875rem;
        min-height: 48px;
    }
    
    /* Theme preview */
    .theme-preview {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    /* Upload section */
    .upload-container {
        padding: 1.5rem 1rem;
    }
    
    .upload-container p {
        font-size: 0.9rem;
    }
    
    /* File list */
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-item .remove-file {
        align-self: flex-end;
    }
    
    /* Model selection */
    #model-select {
        font-size: 1rem;
        padding: 0.875rem;
        min-height: 48px;
    }
    
    /* Toggle switch */
    .toggle-switch {
        width: 180px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(140px);
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .close-modal {
        font-size: 1.8rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Form elements in modals */
    .url-form input,
    .add-slide-form input,
    .add-slide-form textarea {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-buttons button {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    /* Provider options */
    .provider-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Theme preview responsive adjustments */
    .theme-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .font-label {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .font-sample {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .font-select {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .color-grid {
        justify-content: space-around;
    }
    
    .color-item {
        flex: 0 0 calc(33.333% - 1rem);
        min-width: 80px;
    }
    
    .color-swatch {
        width: 50px;
        height: 50px;
    }
    
    /* Result section */
    .presentation-preview {
        gap: 0.75rem;
    }
    
    .slide-preview {
        width: 160px;
        height: 120px;
    }
    
    /* Browse button */
    .browse-btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

/* Smaller mobile devices (390px width) */
@media (max-width: 480px) {
    /* Header */
    header {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo {
        justify-content: center;
    }
    
    /* Hero section */
    .hero {
        min-height: 250px;
        padding: 1.5rem 0.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    
    /* Image layouts */
    .image-layouts-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .layout-preview {
        height: 80px;
    }
    
    /* Image type toggle */
    .image-type-toggle {
        padding: 1rem;
    }
    
    .toggle-switch {
        width: 160px;
        height: 36px;
    }
    
    .toggle-slider:before {
        height: 28px;
        width: 28px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(120px);
    }
    
    .toggle-label-left,
    .toggle-label-right {
        font-size: 0.7rem;
    }
    
    /* Logo upload section */
    .logo-upload-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-upload-area {
        width: 100%;
        height: 180px;
    }
    
    .logo-options {
        width: 100%;
        gap: 1rem;
    }
    
    .logo-option-group {
        padding: 1rem;
    }
    
    .logo-position-options,
    .logo-size-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Slide previews */
    .presentation-preview {
        justify-content: center;
    }
    
    .slide-preview {
        width: 140px;
        height: 100px;
    }
    
    .slide-title {
        font-size: 0.85rem;
    }
    
    .slide-content-preview {
        font-size: 0.75rem;
    }
    
    /* Plus icons */
    .plus-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin: 0 3px;
    }
    
    .slide-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Download button */
    .download-btn {
        width: 100%;
        padding: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Very small devices (around 360px width) */
@media (max-width: 390px) {
    /* Even more compact for very small phones */
    h2 {
        font-size: 1.4rem;
    }
    
    .hero {
        min-height: 220px;
    }
    
    .toggle-switch {
        width: 150px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(110px);
    }
    
    .slide-preview {
        width: 120px;
        height: 90px;
    }
    
    /* Make all buttons full width for better accessibility */
    button {
        min-height: 44px;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 200px;
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        display: none; /* Hide description to save space */
    }
    
    section {
        margin-bottom: 1rem;
    }
    
    .modal-content {
        max-height: 85vh;
        margin: 0.5rem;
    }
}

/* Add Slide Modal */
.add-slide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.add-slide-modal.active {
    display: flex;
}

.add-slide-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.add-slide-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-slide-form label {
    font-weight: 500;
    color: var(--text-color);
}

.add-slide-form .required {
    color: var(--error-color);
}

.add-slide-form input,
.add-slide-form textarea {
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.add-slide-form input:focus,
.add-slide-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-slide-form .form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.add-slide-form .create-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-slide-form .create-btn:hover {
    background-color: #1e46d8;
}

.add-slide-form .cancel-btn {
    background-color: #f1f3f5;
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-slide-form .cancel-btn:hover {
    background-color: #e9ecef;
}

/* Plus Icons for Adding Slides */
.slides-container {
    position: relative;
}

.plus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0 10px;
    opacity: 0.7;
}

.plus-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.slide-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

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

/* Responsive adjustments for plus icons */
@media (max-width: 768px) {
    .plus-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin: 0 5px;
    }
}

@media (max-width: 480px) {
    .plus-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin: 0 3px;
    }
    
    .slide-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .slide-preview {
        width: 100%;
        max-width: none;
    }
}

/* Image Layouts Section */
.image-layouts-section {
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

/* Logo Settings Section */
.logo-settings-section {
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

.logo-upload-container {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 230px;
}

.logo-upload-area {
    width: 300px;
    height: 230px;
    background: white;
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logo-upload-content:hover {
    background-color: #f8f9fa;
}

.logo-upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.logo-upload-content p {
    color: #666;
    text-align: center;
    margin: 0;
}

.logo-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.logo-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.remove-logo-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.remove-logo-btn:hover {
    background-color: #c82333;
}

.logo-options {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo-option-group {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.logo-option-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.logo-position-options,
.logo-size-options {
    display: flex;
    gap: 1.5rem;
}

.logo-position-options .radio-option,
.logo-size-options .radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo-position-options input[type="radio"],
.logo-size-options input[type="radio"] {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .logo-upload-container {
        flex-direction: column;
    }
    
    .logo-upload-area {
        width: 100%;
    }
    
    .logo-options {
        width: 100%;
    }
}

.section-description {
    color: #666;
    margin-bottom: 1.5rem;
}

.image-layouts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.layout-option {
    position: relative;
}

.layout-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.layout-label {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: white;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.layout-radio:checked + .layout-label {
    border-color: var(--primary-color);
    background-color: #f0f5ff;
}

.layout-preview {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    display: flex;
    padding: 8px;
    gap: 8px;
}

.preview-image {
    background: #ddd;
    border-radius: 3px;
}

.preview-text {
    background: #e8e8e8;
    border-radius: 3px;
    flex: 1;
}

/* Full Width Layout Preview */
.full-width-preview {
    flex-direction: column;
}

.full-width-preview .preview-image {
    width: 100%;
    height: 60%;
}

.full-width-preview .preview-text {
    width: 100%;
    height: 30%;
}

/* Side by Side Layout Preview */
.side-by-side-preview {
    flex-direction: row;
}

.side-by-side-preview .preview-image {
    width: 45%;
    height: 100%;
}

.side-by-side-preview .preview-text {
    width: 50%;
    height: 100%;
}

/* Text Focus Layout Preview */
.text-focus-preview {
    flex-direction: row;
}

.text-focus-preview .preview-text {
    width: 65%;
    height: 100%;
}

.text-focus-preview .preview-image {
    width: 30%;
    height: 100%;
}

/* Background Layout Preview */
.background-preview {
    position: relative;
    padding: 0;
}

.preview-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ccc;
    border-radius: 4px;
    opacity: 0.4;
}

.preview-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 40%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
}

/* No Images Layout Preview */
.no-image-preview {
    flex-direction: column;
    justify-content: center;
}

.preview-text-only {
    width: 100%;
    height: 80%;
    background: #e8e8e8;
    border-radius: 3px;
}

.layout-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.layout-desc {
    font-size: 0.85rem;
    color: #666;
}

/* Image Source Selection */
.image-source-selection {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.image-source-selection h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.image-source-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-source-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-source-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-source-option input[type="radio"] {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.image-source-option input[type="radio"]:checked + .source-option-content {
    font-weight: 500;
}

.image-source-option:has(input:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.source-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.source-option-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.source-option-desc {
    font-size: 0.85rem;
    color: #666666;
    line-height: 1.3;
}

/* Local Folder Selection */
.local-folder-selection {
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
    margin-top: 1rem;
}

.folder-selection-area {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.select-folder-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: var(--border-radius);
}

.select-folder-btn:hover {
    background-color: #1a46e0;
}

.select-folder-btn.disabled {
    background-color: #9eb3ff;
    cursor: not-allowed;
    opacity: 0.7;
}

.select-folder-btn.disabled:hover {
    background-color: #9eb3ff;
}

.folder-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

.folder-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.folder-details i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.folder-details #folder-name {
    font-weight: 500;
    color: var(--text-color);
}

.image-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.clear-folder-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.clear-folder-btn:hover {
    color: #e74c3c;
}

/* Image Type Toggle (Legacy - hidden) */
.image-type-toggle {
    display: none;
}

.toggle-switch {
    display: none;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 32px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(160px);
}

.toggle-label-left,
.toggle-label-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    transition: opacity 0.3s;
    width: 100%;
    text-align: center;
}

.toggle-label-left {
    left: 0;
    color: #666;
    opacity: 1;
}

.toggle-label-right {
    right: 0;
    color: #666;
    opacity: 0;
}

.toggle-input:checked ~ .toggle-label-left {
    opacity: 0;
}

.toggle-input:checked ~ .toggle-label-right {
    color: white;
    opacity: 1;
}

.toggle-description {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Settings divider */
.settings-divider {
    margin: 2rem 0 1.5rem;
    border: none;
    border-top: 1px solid var(--light-gray);
}

/* Responsive adjustments for image layouts */
@media (max-width: 768px) {
    .image-layouts-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .layout-preview {
        height: 100px;
    }
    
    .toggle-switch {
        width: 180px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(140px);
    }
    
    .toggle-label-left,
    .toggle-label-right {
        font-size: 0.75rem;
    }
}
