/* Custom styles for the Gato YouTube Player page */

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}

/* Initial Search Area - Centered and full height */
#initial-search-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Take full viewport height */
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Inherit background from body (style.css) */
}

#initial-search-area .logo {
    font-size: 2.5rem; /* Larger logo for central display */
    margin-bottom: 30px;
    color: #01edf0; /* Neon blue/cyan */
    text-shadow: 0 0 10px #01edf0, 0 0 20px #01edf0;
}

/* Header (Top Bar) - Initially hidden, appears after search */
#main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    border-bottom: 2px solid #01edf0; /* Retro border */
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: 0 0 15px rgba(1, 237, 240, 0.5);
}

#main-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #01edf0;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-shadow: 0 0 5px #01edf0;
}

#main-header .logo i {
    color: #ff0000; /* YouTube red */
    margin-right: 5px;
}

.gato-logo-icon {
    height: 1.5em; /* Adjust size as needed */
    margin-right: 5px;
    vertical-align: middle;
}

#initial-search-area .gato-logo-icon {
    height: 2.5rem; /* Larger size for central display */
}

/* Search Forms - Central and Header versions */
#search-form-central, #search-form-header {
    display: flex;
    align-items: center;
    width: 500px;
    max-width: 90%; /* Responsive width */
    margin: 0 auto;
    transition: width 0.3s ease-in-out;
    position: relative; /* Added for dropdown positioning */
}

#search-form-central.focused, #search-form-header.focused {
    width: 700px; /* Expand slightly on focus */
    max-width: 95%;
}

#search-input-central, #search-input-header {
    /* Inherit retro input field styles from style.css */
    flex-grow: 1;
    border-radius: 0; /* Sharp corners */
    border-right: none; /* Remove right border for input */
    /* Apply base input-field styles */
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #01edf0;
    color: #01edf0;
    padding: 10px;
    font-size: 1.2rem;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", "Roboto Mono", monospace;
    outline: none;
    box-shadow: 0 0 10px rgba(1, 237, 240, 0.5), inset 0 0 5px rgba(1, 237, 240, 0.5);
    transition: box-shadow 0.3s ease;
}

#search-input-central:focus, #search-input-header:focus {
    border-color: #01edf0; /* Neon blue focus */
    box-shadow: 0 0 20px #01edf0, inset 0 0 10px #01edf0;
}

#search-button-central, #search-button-header {
    /* Inherit retro button styles from style.css */
    background-color: transparent;
    border: 2px solid #01edf0;
    color: #01edf0;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    text-shadow: 0 0 5px #01edf0;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(1, 237, 240, 0.5);
    border-radius: 0; /* Sharp corners */
    margin-left: -2px; /* Overlap with input border */
}

#search-button-central:hover, #search-button-header:hover {
    background-color: rgba(1, 237, 240, 0.2);
    box-shadow: 0 0 20px #01edf0;
    color: #fff;
}

/* Main Content Area - Initially hidden, appears after search */
#main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Player Container */
#player-container {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #01edf0;
    box-shadow: 0 0 15px rgba(1, 237, 240, 0.5);
    border-radius: 0; /* Retro sharp corners */
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

#player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#player-container p {
    color: #01edf0;
    padding: 20% 0;
    text-align: center;
    font-size: 1.8em; /* Larger font size */
    font-weight: bold; /* Make it bold */
    text-shadow: 0 0 10px #01edf0, 0 0 20px #01edf0; /* Stronger neon glow */
    animation: pulse 2s infinite alternate; /* Add a subtle pulse animation */
}

@keyframes pulse {
    from { text-shadow: 0 0 10px #01edf0, 0 0 20px #01edf0; }
    to { text-shadow: 0 0 15px #01edf0, 0 0 25px #01edf0; }
}

/* Video List Styling */
#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.video-result {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #01edf0;
    box-shadow: 0 0 10px rgba(1, 237, 240, 0.5);
    border-radius: 0;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.video-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px #01edf0;
    background-color: rgba(1, 237, 240, 0.1);
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 thumbnail ratio */
    overflow: hidden;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #01edf0;
}

.video-info {
    padding: 10px;
}

.video-title {
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    margin: 0 0 5px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 0 3px #01edf0;
}

.video-description {
    font-size: 0.8em;
    color: #01edf0;
    opacity: 0.8;
    margin: 0;
    height: 36px; /* Fix height for two lines of text */
    overflow: hidden;
}

/* Message Styling */
.message {
    text-align: center;
    padding: 40px;
    color: #ff007f; /* Use a distinct neon color */
    font-size: 1.5em; /* Larger font size */
    font-weight: bold;
    text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f; /* Stronger neon glow */
    border: 2px solid #ff007f; /* Add a border */
    background-color: rgba(0, 0, 0, 0.7); /* Darker background */
    margin: 20px auto; /* Center it and add margin */
    max-width: 80%; /* Limit width */
    animation: pulse-message 2s infinite alternate; /* Add a subtle pulse animation */
}

@keyframes pulse-message {
    from { text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f; border-color: #ff007f; }
    to { text-shadow: 0 0 15px #ff007f, 0 0 25px #ff007f; border-color: #ff007f; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #search-form-central, #search-form-header {
        width: 95%;
    }

    #search-form-central.focused, #search-form-header.focused {
        width: 100%;
    }

    #initial-search-area .logo {
        font-size: 2rem;
    }

    #main-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    #main-header .logo {
        font-size: 1.2em;
    }

    #search-form-header {
        width: 100%;
    }

    #main-content {
        padding: 10px 0;
    }

    #results-container {
        grid-template-columns: 1fr;
    }
}

/* Search History Styling */
.search-history {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #01edf0;
    box-shadow: 0 0 10px rgba(1, 237, 240, 0.5);
    border-radius: 0;
    width: 500px; /* Match search bar width */
    max-width: 90%;
    margin-top: 5px;
    z-index: 50;
    text-align: left;
}

.search-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-history li {
    padding: 8px 15px;
    color: #01edf0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-history li:hover {
    background-color: rgba(1, 237, 240, 0.2);
    color: #fff;
}

/* Positioning for central search history */
#initial-search-area .search-history {
    top: 100%; /* Position directly below the input */
    left: 0;
    transform: translateX(0); /* Remove horizontal centering */
    width: 100%; /* Span full width of parent form */
}

/* Positioning for header search history */
#main-header .search-history {
    top: 100%; /* Position directly below the input */
    left: 0;
    transform: translateX(0); /* Remove horizontal centering */
    width: 100%; /* Span full width of parent form */
}

/* Autocomplete Suggestions Styling */
.autocomplete-suggestions {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff007f; /* Different color for suggestions */
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
    border-radius: 0;
    width: 500px; /* Match search bar width */
    max-width: 90%;
    margin-top: 5px;
    z-index: 51; /* Higher z-index than history */
    text-align: left;
}

.autocomplete-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.autocomplete-suggestions li {
    padding: 8px 15px;
    color: #ff007f;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.autocomplete-suggestions li:hover {
    background-color: rgba(255, 0, 127, 0.2);
    color: #fff;
}

/* Positioning for central autocomplete suggestions */
#initial-search-area .autocomplete-suggestions {
    top: 100%; /* Position directly below the input */
    left: 0;
    transform: translateX(0); /* Remove horizontal centering */
    width: 100%; /* Span full width of parent form */
}

/* Positioning for header autocomplete suggestions */
#main-header .autocomplete-suggestions {
    top: 100%; /* Position directly below the input */
    left: 0;
    transform: translateX(0); /* Remove horizontal centering */
    width: 100%; /* Span full width of parent form */
}

/* Video Details Container */
#video-details-container {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff007f; /* Use a different neon color for details */
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.5);
    border-radius: 0;
    padding: 15px;
    margin-bottom: 20px;
    color: #fff;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", "Roboto Mono", monospace;
}

#video-details-container h3 {
    font-size: 1.5em;
    color: #01edf0; /* Neon blue for title */
    text-shadow: 0 0 8px #01edf0;
    margin-top: 0;
    margin-bottom: 10px;
}

#video-details-container p {
    font-size: 0.9em;
    color: #ff007f; /* Neon pink for other details */
    text-shadow: 0 0 5px #ff007f;
    margin: 5px 0;
}

/* Loading Spinner Styling */
.loading-spinner {
    border: 4px solid rgba(1, 237, 240, 0.3);
    border-top: 4px solid #01edf0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}