/* OSHIFIED App Styles */

/* App Container */
body {
    background-color: var(--background-color);
    overflow-y: auto;
}

body.scroll-locked {
    overflow: hidden;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: 100px; /* Account for fixed header */
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(
        180deg,
        var(--background-color) 0%,
        rgba(242, 221, 213, 0.98) 100%
    );
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-light);
    z-index: 100;
    padding: 1.5rem;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.app-title {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    margin: 0;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.app-title:hover {
    opacity: 0.8;
}

.mode-badge {
    font-family: var(--font-display);
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--background-color);
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(242, 133, 162, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin: 0 0 1.5rem 0;
}

.modal-message {
    margin-bottom: 1.5rem;
}

.message-main {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.message-secondary {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.message-tertiary {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
}

.modal-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--primary-light),
        transparent
    );
    margin: 1.5rem 0;
}

.privacy-note {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 133, 162, 0.3);
}

/* Input Sections */
.input-section {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-icon {
    font-size: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.section-description {
    font-family: var(--font-body);
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Upload Areas */
.upload-area {
    border: 3px dashed var(--primary-light);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

/* Clear Button */
.clear-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.clear-button:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.clear-button svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

/* Clear button for YouTube input container */
.youtube-input-container {
    position: relative;
}

.youtube-input-container .clear-button {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(242, 133, 162, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    width: 50px;
    height: 50px;
    fill: var(--primary-light);
    transition: fill 0.3s ease;
    margin-bottom: 0.75rem;
}

.upload-area:hover .upload-icon {
    fill: var(--primary-color);
}

.upload-text {
    font-family: var(--font-body);
    color: var(--primary-color);
    font-weight: 500;
    margin: 0;
}

.upload-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    margin-top: 1rem;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.toggle-button {
    flex: 1;
    padding: 1rem;
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    border-color: var(--primary-color);
    background: rgba(242, 133, 162, 0.1);
}

.toggle-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Generate Button */
.generate-button {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 15px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 5px 20px rgba(242, 133, 162, 0.3);
}

.generate-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(242, 133, 162, 0.4);
}

.generate-button:active {
    transform: translateY(-1px);
}

/* Progress Section */
.progress-section {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.progress-segments {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-segment {
    position: relative;
}

.segment-label {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    display: block;
}

.segment-fill {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.segment-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-segment[data-segment="1"] .segment-fill::after {
    background: var(--primary-color);
}

.progress-segment[data-segment="2"] .segment-fill::after {
    background: var(--secondary-color);
}

.progress-segment[data-segment="3"] .segment-fill::after {
    background: var(--accent-color);
}

.progress-segment.active .segment-fill::after {
    width: 100%;
}

/* Results Section */
.results-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.results-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-image-container {
    text-align: center;
}

.result-label {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.result-image {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.result-video-container {
    text-align: center;
}

.result-video {
    width: 100%;
    max-width: 600px;
    border-radius: 15px;
    margin: 1rem auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 187, 119, 0.3);
}

/* Presets Divider */
.presets-divider {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #999;
    text-align: center;
    margin: 1.5rem 0 1rem 0;
}

/* Preset Gallery */
.preset-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.preset-item {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    aspect-ratio: 1;
}

.preset-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(242, 133, 162, 0.2);
}

.preset-item.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(242, 133, 162, 0.2);
}

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

.preset-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    color: white;
    font-family: var(--font-body);
    font-size: 0.7rem;
    padding: 0.5rem;
    text-align: center;
}

.preset-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 0.5rem 0.25rem;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
}

.preset-check {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.preset-item.selected .preset-check {
    display: flex;
}

/* YouTube Link Input */
.youtube-input-container {
    width: 100%;
}

.youtube-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: #333;
    background: white;
    transition: all 0.3s ease;
}

.youtube-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(242, 133, 162, 0.1);
}

.youtube-input::placeholder {
    color: #999;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.download-button,
.share-button,
.restart-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button {
    background: var(--secondary-color);
    color: white;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(153, 182, 242, 0.3);
}

.download-button {
    background: var(--accent-color);
    color: white;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 187, 119, 0.3);
}

.restart-button {
    background: var(--primary-color);
    color: white;
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 133, 162, 0.3);
}

.download-button svg,
.share-button svg,
.restart-button svg {
    width: 20px;
    height: 20px;
}

/* Gallery Attribution */
.gallery-attribution {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    margin-top: 1rem;
}

.attribution-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.attribution-link:hover {
    opacity: 0.7;
}

/* Step Navigation */
.step-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        0deg,
        var(--background-color) 0%,
        rgba(242, 221, 213, 0.98) 100%
    );
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary-light);
    padding: 1rem 1.5rem;
    z-index: 99;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
}

.step-navigation.hidden {
    display: none;
}

.step-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background: white;
    color: var(--primary-color);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 133, 162, 0.3);
}

.step-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.step-button svg {
    width: 18px;
    height: 18px;
}

.next-button {
    margin-left: auto;
}

/* Loading Spinner Animation */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem 1rem;
        padding-top: 120px;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .mode-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .message-main {
        font-size: 1.1rem;
    }

    .results-images {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .upload-area {
        padding: 1.5rem 1rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .download-button,
    .share-button {
        width: 100%;
    }

    /* Adjust section heights for mobile */
    .input-section,
    .progress-section {
        min-height: 60vh;
    }

    .results-section {
        min-height: auto;
        padding-bottom: 3rem;
    }

    /* Preset gallery mobile */
    .preset-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .preset-name {
        font-size: 0.6rem;
    }
}
