/* Global Styles & Dark Mode Base */
body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a1a;
    /* Dark background */
    color: #e0e0e0;
    /* Light text for readability */
    display: flex;
    flex-direction: column;
    /* Changed to column to stack title, container, and footer */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    /* Refined background with subtle red/pinkish glow */
    background: radial-gradient(circle at 80% 20%, rgba(255, 0, 0, 0.05), transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(255, 100, 100, 0.03), transparent 60%),
        #1a1a1a;
    /* Base dark color */
    background-attachment: fixed;
}

/* Main Title Styling (moved outside container) */
.main-title {
    font-weight: 700;
    color: white;
    /* Changed to white */
    margin-bottom: 40px;
    /* Increased margin below title */
    font-size: 3.5em;
    /* Significantly larger heading */
    /* Removed text-shadow: 0 5px 15px rgba(255, 0, 0, 0.5); */
    /* Glow removed */
    text-align: center;
    padding-top: 20px;
    /* Add some padding at the top of the page */
}

/* Full-screen Drag-and-Drop Overlay */
#dragDropOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Darker, more prominent overlay */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Ensure it's on top of everything */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Allows clicks/interactions with elements beneath when hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#dragDropOverlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Allows interaction when active */
}

#dragDropOverlay .message-box {
    color: white;
    font-size: 2.5em;
    /* Large message */
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.9);
    /* Stronger glow */
    border: 4px dashed #FF0000;
    /* Dashed YouTube Red border */
    padding: 60px 80px;
    /* Generous padding */
    border-radius: 25px;
    /* Rounded corners */
    background: rgba(255, 0, 0, 0.1);
    /* Subtle red background */
    transition: all 0.3s ease;
    transform: scale(1);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.7);
    /* Glowing box shadow */
}

#dragDropOverlay.active .message-box {
    transform: scale(1.05);
    /* Slightly scale up on active drag */
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.9);
    /* More intense glow */
}


/* Glassmorphism Container */
.container {
    background: rgba(255, 255, 255, 0.05);
    /* Semi-transparent white */
    backdrop-filter: blur(15px);
    /* Blur effect */
    -webkit-backdrop-filter: blur(15px);
    /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    border-radius: 25px;
    /* More rounded corners */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    /* Soft shadow */
    padding: 50px;
    /* Increased padding for a much bigger feel */
    max-width: 900px;
    /* Significantly increased max-width */
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 35px;
    /* Increased gap between elements */
    animation: fadeIn 1s ease-out;
    margin-top: 0;
    /* Keep this as the body's flex will handle overall spacing */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Removed h1 style from here as it's now a global .main-title */
p {
    font-size: 1.2em;
    /* Significantly larger paragraph text */
    color: #c0c0c0;
}

/* Input Field Styling */
.input-group {
    position: relative;
    width: 100%;
}

input[type="text"] {
    width: calc(100% - 40px);
    /* Adjust for padding */
    padding: 20px;
    /* Increased padding */
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Softer border */
    border-radius: 15px;
    /* Slightly more rounded */
    background-color: rgba(255, 255, 255, 0.03);
    /* Even more subtle background */
    color: #f0f0f0;
    font-size: 1.3em;
    /* Larger font size */
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
    /* Lighter placeholder */
}

input[type="text"]:focus {
    border-color: #FF0000;
    /* YouTube Red */
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    /* Stronger glowing effect */
}

/* Button Styling */
button {
    background: linear-gradient(135deg, #CC0000, #FF0000);
    /* YouTube Red gradient */
    color: white;
    border: none;
    padding: 18px 40px;
    /* Increased padding */
    border-radius: 15px;
    /* Slightly more rounded */
    font-size: 1.2em;
    /* Larger font size */
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
    /* Stronger YouTube Red shadow */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Increased gap */
}

button:hover {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    /* Inverted gradient on hover */
    transform: translateY(-3px);
    /* More pronounced hover effect */
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.8);
    /* Even stronger YouTube Red shadow */
}

button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    /* Softer YouTube Red shadow on active */
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    justify-content: center;
    gap: 20px;
    /* Increased gap */
    margin-top: 15px;
    /* Increased margin */
}

/* Result Display Area */
.result-area {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    /* More rounded */
    padding: 35px;
    /* Increased padding */
    margin-top: 35px;
    /* Increased margin */
    display: none;
    /* Hidden by default */
    flex-direction: column;
    gap: 25px;
    /* Increased gap */
    align-items: center;
    animation: slideIn 0.5s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        display: flex;
    }

    /* Ensure display:flex is set at end */
}

.thumbnail-link-display {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    /* More rounded */
    padding: 15px 20px;
    /* Increased padding */
    word-break: break-all;
    font-size: 1.1em;
    /* Larger font */
    color: #FFCCCC;
    /* Light red/pink for links, subtle YT theme */
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    user-select: all;
    /* Allow easy selection for copying */
}

.thumbnail-image {
    max-width: 100%;
    /* Ensures image is always within its parent's width */
    height: auto;
    /* Maintains aspect ratio */
    border-radius: 20px;
    /* More rounded */
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
    border: 3px solid rgba(255, 0, 0, 0.6);
    /* Slightly thicker YouTube Red border */
    transition: transform 0.3s ease;
}

.thumbnail-image:hover {
    transform: scale(1.03);
    /* More pronounced hover effect */
}

/* Messages */
.message {
    margin-top: 20px;
    /* Increased margin */
    padding: 15px 20px;
    /* Increased padding */
    border-radius: 12px;
    /* More rounded */
    font-size: 1em;
    /* Slightly larger font */
    font-weight: 500;
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.3s ease-out forwards;
}

.message.success {
    background-color: rgba(46, 204, 113, 0.2);
    /* Green success */
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.message.error {
    background-color: rgba(231, 76, 60, 0.2);
    /* Red error */
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* Footer styling */
.footer-text {
    margin-top: auto;
    /* Push footer to the bottom */
    padding-top: 30px;
    /* Spacing from content above */
    padding-bottom: 20px;
    /* Padding at the very bottom */
    font-size: 0.9em;
    /* Slightly smaller font */
    color: #6B7280;
    /* Gray 500 */
    text-align: center;
    width: 100%;
    /* Ensure it spans full width */
}

/* Responsive Adjustments */
@media (max-width: 992px) {

    /* Adjusted breakpoint for larger container */
    .container {
        padding: 40px;
        max-width: 80%;
    }

    .main-title {
        font-size: 3em;
    }

    p {
        font-size: 1.1em;
    }

    input[type="text"] {
        font-size: 1.2em;
        padding: 18px;
    }

    button {
        font-size: 1.1em;
        padding: 16px 35px;
    }

    .result-area {
        padding: 30px;
    }

    .thumbnail-link-display {
        font-size: 1em;
        padding: 14px 18px;
    }

    #dragDropOverlay .message-box {
        font-size: 2em;
        padding: 50px 70px;
    }
}

@media (max-width: 768px) {

    /* Tablet breakpoint */
    .container {
        padding: 30px;
        max-width: 90%;
    }

    .main-title {
        font-size: 2.5em;
        margin-bottom: 30px;
    }

    p {
        font-size: 1em;
    }

    input[type="text"] {
        font-size: 1.1em;
        padding: 15px;
    }

    button {
        font-size: 1em;
        padding: 14px 30px;
    }

    .result-area {
        padding: 25px;
    }

    .thumbnail-link-display {
        font-size: 0.95em;
        padding: 12px 15px;
    }

    #dragDropOverlay .message-box {
        font-size: 1.8em;
        padding: 40px 60px;
    }
}

@media (max-width: 480px) {

    /* Mobile breakpoint */
    .container {
        padding: 20px;
        gap: 20px;
    }

    .main-title {
        font-size: 2em;
        margin-bottom: 20px;
    }

    p {
        font-size: 0.9em;
    }

    input[type="text"] {
        font-size: 0.95em;
        padding: 12px;
    }

    button {
        font-size: 0.95em;
        padding: 12px 25px;
    }

    .button-group {
        gap: 10px;
    }

    .result-area {
        padding: 20px;
        gap: 15px;
    }

    .thumbnail-link-display {
        font-size: 0.85em;
        padding: 10px 12px;
    }

    .message {
        font-size: 0.85em;
        padding: 10px 12px;
    }

    #dragDropOverlay .message-box {
        font-size: 1.5em;
        padding: 30px 40px;
    }
}
