/* --- Gumroad Inspired Theme - High Contrast Black & White (Corrected) --- */

body {
    font-family: "Mabry Pro", system-ui, -apple-system, sans-serif;
    background-color: #f9fafb;
    color: #000000;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- NEW Main Content Wrapper for Centering --- */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers the h1 and .container */
    width: 100%;
}


/* --- NAVIGATION BAR STYLES --- */
.main-nav {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 2px solid #000000;
    padding: 10px 0;
    box-sizing: border-box;
    z-index: 1000;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #000000;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #000000;
    font-weight: 600;
    font-size: 1em;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease-in-out;
}

.nav-links a:hover {
    border-bottom-color: #000000;
}


/* --- Page Content Styles --- */
h1 {
    margin: 40px 0;
    font-size: 2.5em;
    font-weight: 700;
    color: #000000;
    text-align: center; /* Added for better responsiveness */
}

.container {
    background-color: #ffffff;
    border-radius: 6px;
    border: 2px solid #000000;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 6px 6px 0px #000000;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease-in-out;
}
.subtitle {
    text-align: center;
    color: #555;
    max-width: 600px; 
    margin-left: auto;   
    margin-right: auto;  
    margin-bottom: 30px; 
    line-height: 1.6;    
}

input[type="text"],
input[type="number"],
input[type="email"] {
    width: calc(100% - 32px);
    padding: 12px 16px;
    margin: 10px 0;
    border: 2px solid #000000;
    border-radius: 6px;
    background-color: #ffffff;
    color: #000000;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px #000000;
}

input[type="text"]::placeholder {
    color: #888;
}

button {
    padding: 12px 24px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    margin: 5px;
}

button:hover {
    background-color: #ffffff;
    color: #000000;
}

button:disabled {
    background-color: #f2f2f2;
    color: #999;
    border-color: #999;
    cursor: not-allowed;
}

.audio-button,
.crop-button {
    background-color: #000000;
}

.audio-button:hover,
.crop-button:hover {
    background-color: #ffffff;
    color: #000000;
}

#videoContainer {
    margin: 20px 0;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #e0e0e0;
    border-radius: 12px;
    border: 2px solid #000;
    overflow: hidden;
}

#videoContainer iframe {
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* --- UPDATED: Time Input Styles --- */
.time-inputs-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.time-input {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 45%;
}
.time-input label {
    font-weight: 600;
    font-size: 14px;
}
.time-input .inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}
.time-input input[type="number"] {
    width: 100%;
    text-align: center;
}

/* --- NEW: Range Slider Styles --- */
.slider-container {
    position: relative;
    width: 100%;
    height: 20px;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
    user-select: none; /* Prevents text selection while dragging */
}
.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
}
.slider-range {
    position: absolute;
    height: 4px;
    background-color: #000000;
    border-radius: 2px;
}
.slider-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #000000;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: grab;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.slider-handle:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.1);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: transparent;
    border: 2px solid #000;
    border-radius: 6px;
    margin-bottom: 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.format-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.format-button {
    padding: 8px 16px;
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.format-button.active {
    background-color: #000;
    color: #fff;
}

.format-button:hover:not(.active) {
    background-color: #f0f0f0;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.41 0L6 4.58L10.59 0L12 1.41L6 7.41L0 1.41L1.41 0Z' fill='%23000000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding: 12px 40px 12px 16px;
    background-color: #fff;
    color: #000;
    border: 2px solid #000000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

select:focus {
    outline: none;
    box-shadow: 0 0 0 3px #000000;
}

#progressSection {
    margin-top: 20px;
    width: 100%;
}

#progressBarContainer {
    width: 100%;
    background-color: #fff;
    border-radius: 4px;
    border: 2px solid #000;
    height: 12px;
    overflow: hidden; /* Ensures the inner bar stays contained */
}

#progressBar {
    height: 100%; /* Fills the parent container's height */
    background-color: #000000;
    width: 0%;
    transition: width 0.3s;
}

#progressText {
    margin-top: 8px;
    text-align: center;
    color: #888;
}

#trimmedVideoContainer {
    width: 100%;
    margin-top: 20px;
}

#trimmedVideoContainer video {
    width: 100%;
    border-radius: 12px;
    background-color: #e0e0e0;
}

#trimmedVideoContainer audio {
    width: 100%;
    margin: 16px 0;
}

#downloadButton {
    margin-top: 16px;
}

.error-message {
    background-color: #ffeeee;
    border: 2px solid #d8000c;
    padding: 12px;
    margin: 16px 0;
    border-radius: 6px;
    display: none;
    color: #d8000c;
    font-weight: 500;
}

.status-message {
    margin-top: 12px;
    text-align: center;
    color: #666;
}

.help-text {
    font-size: 14px;
    color: #888;
    margin-top: 8px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.aspect-ratio-section {
    display: none;
    margin-top: 20px;
}

.crop-preview-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 16px auto;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
}

.crop-preview-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
}

.crop-area {
    position: absolute;
    border: 3px dashed #ffffff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    cursor: move;
    pointer-events: all;
    background: transparent;
    box-sizing: border-box;
}

.crop-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #000000;
    border: 3px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: all;
    z-index: 20;
}

.crop-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.crop-preview-info {
    text-align: center;
    margin: 12px 0;
    color: #bbb;
    font-size: 14px;
    font-weight: 500;
}

.video-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.control-button {
    background-color: #eee;
    color: #000;
    border: 2px solid #000;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.control-button:hover {
    background-color: #ddd;
}

.control-button.playing,
.control-button.active {
    background-color: #000;
    color: #fff;
}

.crop-area::before,
.crop-area::after {
    display: none;
}

/* --- NEW: Shareable Link Styles --- */
.share-link-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}
.share-link-container label {
    font-weight: 600;
    font-size: 14px;
}
.link-wrapper {
    display: flex;
}
.link-wrapper input {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.link-wrapper button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin: 10px 0; /* Align with input's margin */
    white-space: nowrap;
}

.info-section { width: 100%; max-width: 1000px; margin: 80px auto; padding: 0 20px; box-sizing: border-box; text-align: center; }
        .info-section h2 { font-size: 2em; font-weight: 700; margin-bottom: 40px; }
        .steps-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
        .step-card { background-color: #ffffff; border: 2px solid #000000; border-radius: 6px; padding: 30px; text-align: center; box-shadow: 6px 6px 0px black; transition: transform 0.2s, box-shadow 0.2s; }
        .step-card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0px black; }
        .step-number { width: 50px; height: 50px; background-color: #000; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5em; font-weight: 700; margin: 0 auto 20px auto; }
        .step-card h3 { margin: 0 0 10px 0; font-size: 1.25em; }
        .step-card p { color: #555; line-height: 1.6; }
        .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
        .feature-card { border: solid 2px #000000; border-radius: 6px; background-color: #ffffff; padding: 2rem; text-align: left; transition: transform 0.2s, box-shadow 0.2s; }
        .feature-card:hover { transform: translateY(-5px); box-shadow: 6px 6px 0px black; }
        .feature-icon { font-size: 2.5em; margin-bottom: 1rem; }
        .faq-container { max-width: 800px; margin: 0 auto; text-align: left; }
        .faq-item { border: solid 2px #000000; border-radius: 6px; margin-bottom: 1rem; padding: 1rem 1.5rem; background-color: #ffffff; }
        .faq-item summary { font-size: 1.2em; font-weight: 600; cursor: pointer; list-style-position: inside; }
        .faq-item p { margin-top: 1rem; color: #555; line-height: 1.6; }
        .social-proof-section { text-align: center; background-color: #ffffff; border: solid 2px #000000; padding: 3rem 2rem; border-radius: 6px; max-width: 1000px; margin: 80px auto; }
        .social-buttons { display: flex; justify-content: center; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
        .social-button, .cta-button { padding: 12px 24px; background-color:#000000; color: #ffffff; border: 2px solid #000000; border-radius: 6px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
        .social-button:hover, .cta-button:hover { background-color: #ffffff; color: #000000; }
        .main-footer { width: 100%; background-color: #000000; color: #ffffff; padding: 40px 20px; box-sizing: border-box; margin-top: 80px; }
        .footer-container { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
        .footer-logo { font-size: 1.8em; font-weight: 700; margin-bottom: 20px; }
        .footer-links { display: flex; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center;}
        .footer-links a { color: #ffffff; text-decoration: none; font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
        .footer-links a:hover { opacity: 1; }
        .footer-socials { display: flex; gap: 20px; margin-bottom: 20px; }
        .footer-socials a { color: #ffffff; opacity: 0.8; transition: opacity 0.2s; }
        .footer-socials a:hover { opacity: 1; }
        .footer-copyright { font-size: 0.9em; opacity: 0.6; }


/* --- Responsive styles for smaller screens --- */
        @media (max-width: 768px) {
            .nav-container { flex-direction: column; gap: 15px; }
            .nav-links { gap: 20px; justify-content: center; width: 100%; }
        }
        @media (max-width: 480px) {
            .nav-links a { font-size: 0.9em; }
            .container, .step-card, .feature-card { box-shadow: 4px 4px 0px #000000; }
            .step-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0px black; }
            .feature-card:hover { transform: translateY(-3px); box-shadow: 4px 4px 0px black; }
        }