/* ===================================
   SHARED STYLES FOR BOTH PAGES
   =================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    min-width: 320px;
}

/* ===================================
   LANDING PAGE STYLES (index.html)
   =================================== */

/* Hero Section - Full Screen Blue Background */
.hero {
    background: linear-gradient(135deg, #0079d3 0%, #0066b8 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header with Brand Name and Lines */
.header {
    padding: 30px 50px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.header-actions {
    margin-left: auto;
}

.nav-link {
    display: inline-block;
    text-decoration: none;
    color: #0079d3;
    background: white;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.nav-link-light {
    color: #0079d3;
    background: white;
}

.brand-lines {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.line {
    width: 4px;
    height: 60px;
    background: white;
    border-radius: 2px;
}

.brand-name {
    font-size: 48px;
    font-weight: bold;
    color: white;
    letter-spacing: -1px;
}

/* Top Right Decorative Circle */
.top-decoration {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
}

.stripes {
    display: flex;
    height: 100%;
    transform: rotate(0deg);
}

.stripe {
    flex: 1;
    background: white;
    opacity: 0.3;
    margin: 0 3px;
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

.title {
    font-size: clamp(2.2rem, 7vw, 72px);
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(1.05rem, 2.5vw, 24px);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 80px;
    text-align: center;
}

/* Platform Icons Container */
.platforms {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.platform-icon {
    width: 140px;
    height: 140px;
    background: rgba(100, 210, 230, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.platform-icon:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.platform-icon:active {
    transform: scale(1.05) translateY(-2px);
}

/* SVG Icons Styling */
.platform-icon svg {
    width: 70px;
    height: 70px;
    fill: white;
}

/* Platform Label */
.platform-label {
    color: white;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 4px;
    text-align: center;
    opacity: 0.9;
}

/* ===================================
   DOWNLOAD PAGE STYLES (download.html)
   =================================== */

/* Main Content Area with Blue Background */
.main-content {
    background: #0079d3;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    position: relative;
    min-height: calc(100vh - 150px);
}

.download-top-row {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-top-row .back-button-container {
    width: auto;
    max-width: none;
    margin-bottom: 0;
}

/* Back Button Container */
.back-button-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

/* Back Button (Left Side) */
.back-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.back-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Dynamic Platform Icon Circle (Top-Center) */
.platform-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #6af0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 80px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.platform-circle svg {
    width: 60px;
    height: 60px;
    fill: white;
}

/* Input and Download Section */
.input-section {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 auto;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Input Box */
.input-box {
    flex: 1;
    background: white;
    border: 3px solid #a855f7;
    border-radius: 50px;
    padding: 20px 35px;
    font-size: 24px;
    outline: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.input-box::placeholder {
    color: #cccccc;
    font-size: 24px;
}

.input-box:focus {
    border-color: #9333ea;
    box-shadow: 0 8px 40px rgba(168, 85, 247, 0.3);
}

/* Download Button */
.download-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.download-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

.download-button svg {
    width: 35px;
    height: 35px;
    fill: white;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 7px 12px;
    width: fit-content;
}

.platform-badge svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Format Selection */
.format-section {
    width: 100%;
    max-width: 900px;
    margin-top: 28px;
}

.format-selector-section {
    width: 100%;
    max-width: 900px;
    margin-top: 18px;
}

.format-select-label {
    display: block;
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.format-select {
    width: 100%;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 14px;
    outline: none;
}

.format-select option {
    color: #111;
}

.preview-card {
    width: 100%;
    max-width: 900px;
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
}

.preview-thumbnail {
    width: 100%;
    height: 100%;
    min-height: 105px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
}

.preview-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.preview-title {
    color: white;
    font-size: 20px;
    line-height: 1.3;
}

.preview-uploader,
.preview-duration {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
}

.preview-skeleton {
    align-items: center;
}

.preview-thumb-skeleton {
    width: 100%;
    min-height: 105px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 1.4s ease-in-out infinite;
}

.preview-meta-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 999px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-line.short {
    width: 70%;
}

.skeleton-line.tiny {
    width: 40%;
}

@keyframes pulse {
    0% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.35;
    }
}

.download-progress {
    width: 100%;
    max-width: 900px;
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-progress.error {
    background: rgba(127, 29, 29, 0.45);
    border-color: rgba(252, 165, 165, 0.5);
}

.progress-status {
    color: white;
    font-size: 14px;
    margin-bottom: 8px;
}

.format-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: center;
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.format-button {
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.format-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Download Progress */
.progress-section {
    width: 100%;
    max-width: 900px;
    margin-top: 22px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.15);
}

.progress-label {
    color: white;
    font-size: 14px;
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #facc15 0%, #f97316 100%);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.progress-fill.error,
.progress-bar.error {
    background: rgba(239, 68, 68, 0.9);
}

.progress-percent {
    margin-top: 8px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.is-hidden {
    display: none !important;
}

/* Spinner Animation */
.download-button .spinner {
    width: 35px;
    height: 35px;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    margin-top: 20px;
    padding: 15px 25px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

.error-message.success {
    background: rgba(16, 185, 129, 0.9);
}

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

/* Disabled Input State */
.input-box:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   SHARED FOOTER STYLES
   =================================== */

/* Footer Section */
.footer {
    background: #111111;
    padding: 30px 20px;
    text-align: center;
    color: white;
}

.footer-text {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
}

.footer-icon-link {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    fill: white;
    display: block;
}

.footer-icon-link:hover .footer-icon {
    transform: scale(1.2);
    fill: rgba(255, 255, 255, 0.9);
}

/* ===================================
   HISTORY PAGE STYLES
   =================================== */

.history-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0079d3 0%, #0066b8 100%);
    padding: 34px 20px 60px;
}

.history-header {
    max-width: 1080px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-title {
    color: white;
    font-size: 40px;
    text-align: center;
    flex: 1;
}

.history-clear-btn {
    border: none;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.history-clear-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.history-empty {
    max-width: 780px;
    margin: 80px auto 0;
    padding: 35px 24px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    text-align: center;
    color: white;
}

.history-empty h2 {
    font-size: 30px;
    margin-bottom: 8px;
}

.history-empty p {
    font-size: 16px;
    margin-bottom: 18px;
}

.history-primary-link {
    display: inline-block;
    text-decoration: none;
    background: white;
    color: #0079d3;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
}

.history-list {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.history-card {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    display: grid;
    grid-template-columns: 170px 1fr auto;
    gap: 14px;
    padding: 14px;
    align-items: center;
}

.history-thumb {
    width: 100%;
    height: 95px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
}

.history-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.history-meta {
    min-width: 0;
}

.history-card-title {
    color: white;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 8px;
    word-break: break-word;
}

.history-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.history-platform-badge,
.history-format-badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.24);
    color: white;
}

.history-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.history-download-again {
    text-decoration: none;
    background: white;
    color: #0079d3;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

@media (max-width: 768px) {
    /* Landing Page Responsive */
    .header {
        padding: 20px 30px;
    }

    .brand-name {
        font-size: 36px;
    }

    .line {
        height: 45px;
        width: 3px;
    }

    .title {
        font-size: 48px;
    }

    .subtitle {
        font-size: 18px;
        margin-bottom: 60px;
    }

    .platforms {
        gap: 30px;
    }

    .platform-icon {
        width: 120px;
        height: 120px;
    }

    .platform-icon svg {
        width: 60px;
        height: 60px;
    }

    .top-decoration {
        width: 200px;
        height: 200px;
        top: -50px;
        right: -50px;
    }

    /* Download Page Responsive */
    .main-content {
        padding: 30px 15px 40px;
    }

    .download-top-row {
        margin-bottom: 16px;
        gap: 12px;
    }

    .back-button {
        width: 50px;
        height: 50px;
    }

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

    .platform-circle {
        width: 100px;
        height: 100px;
        margin-bottom: 60px;
    }

    .platform-circle svg {
        width: 50px;
        height: 50px;
    }

    .input-section {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }

    .input-wrapper {
        width: 100%;
    }

    .input-box {
        width: 100%;
        font-size: 18px;
        padding: 18px 25px;
    }

    .input-box::placeholder {
        font-size: 18px;
    }

    .download-button {
        width: 60px;
        height: 60px;
    }

    .preview-card,
    .format-selector-section,
    .download-progress,
    .error-message {
        max-width: 100%;
    }

    .error-message {
        font-size: 14px;
        padding: 12px 20px;
        margin-top: 15px;
    }

    .format-title {
        font-size: 16px;
    }

    .format-button {
        font-size: 13px;
        padding: 10px 14px;
    }

    .preview-card {
        grid-template-columns: 1fr;
    }

    .preview-thumbnail,
    .preview-thumb-skeleton {
        min-height: 170px;
    }

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

    .history-title {
        width: 100%;
        order: 3;
        font-size: 32px;
    }

    .history-card {
        grid-template-columns: 1fr;
    }

    .history-thumb {
        height: 180px;
    }

    .history-download-again {
        width: 100%;
        text-align: center;
    }

    .footer-text {
        font-size: 22px;
    }

    .footer-icons {
        gap: 25px;
    }

    .footer-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    /* Landing Page Mobile */
    .header {
        padding: 15px 20px;
    }

    .nav-link {
        font-size: 13px;
        padding: 8px 12px;
    }

    .brand-name {
        font-size: 28px;
    }

    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .platforms {
        width: min(100%, 280px);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        margin-bottom: 28px;
    }

    .platform-icon {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .platform-icon svg {
        width: 50px;
        height: 50px;
    }

    /* Download Page Mobile */
    .input-box {
        font-size: 16px;
        padding: 15px 20px;
    }

    .input-box::placeholder {
        font-size: 16px;
    }

    .download-top-row {
        width: 100%;
    }

    .download-top-row .nav-link {
        font-size: 13px;
        padding: 8px 12px;
    }

    .footer-text {
        font-size: 18px;
    }

    .footer-icons {
        gap: 20px;
    }

    .format-button {
        width: 100%;
        border-radius: 14px;
        text-align: center;
    }

    .progress-section {
        padding: 12px 14px;
    }

    .download-progress {
        padding: 12px 14px;
    }

    .preview-title {
        font-size: 18px;
    }

    .history-title {
        font-size: 28px;
    }

    .history-thumb {
        height: 150px;
    }

    .history-header {
        gap: 10px;
    }

    .history-clear-btn {
        width: 100%;
    }

    .platform-label {
        letter-spacing: 2px;
        font-size: 13px;
    }
}
