/* Custom styles for a dark, TV-like experience */
:root {
    --primary-blue: #3b82f6;
    --dark-bg: #1f2937;
    --tile-bg: #374151;
    --border-color: #4b5563;
}

body {
    font-family: 'Inter', sans-serif;
    /* Gradient Black Background */
    background: linear-gradient(to bottom, #111111, #000000); 
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

/* Navigation and Header */
header {
    width: 100%;
    margin-bottom: 1rem;
}

/* Style for the wallpaper/banner area */
#header-wallpaper {
    background-color: #1e293b;
    border: 2px solid var(--primary-blue);
}

.nav-link {
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-weight: 600; /* Semibold */
    color: #9ca3af; /* Gray-400 */
    transition: color 0.2s, border-bottom 0.2s;
    white-space: nowrap; /* Ensures navigation links don't wrap */
}

.nav-link:hover {
    color: #e5e7eb; /* Gray-200 */
}

.nav-link.active {
    color: #ffffff; /* White */
    border-bottom: 2px solid #3b82f6; /* Blue-500 */
}

/* --- App/Tile Grid Layout --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding-bottom: 1rem;
}

.logo-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #374151; /* Gray-700 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    text-align: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.1s, background-color 0.1s;
    cursor: pointer;
}

.logo-tile:hover {
    transform: translateY(-2px);
    background-color: #4b5563; /* Gray-600 */
}

.logo-tile img {
    width: 64px;
    height: 64px;
    border-radius: 0.375rem;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.logo-tile span {
    font-size: 0.75rem; /* text-xs */
    word-break: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.25em; /* Limit to 2 lines for better display */
    line-height: 1.2;
}

/* Specific styling for the 'Add New App' tile */
.add-app-tile {
    background-color: #1f2937; /* Match body background */
    border: 2px dashed #4b5563; /* Gray-600 border */
    color: #4b5563; /* Gray-600 text */
    opacity: 0.8;
}

.add-app-tile:hover {
    background-color: #1f2937;
    transform: none; /* No hover lift */
}

/* Delete Button for user-added tiles */
.delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444; /* Red-500 */
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    opacity: 0.8;
}

.delete-btn:hover {
    opacity: 1;
}

/* --- Management Form Styles & Notes Input --- */
.management-section input[type="text"],
#technicalNotesInput,
#pinInput { 
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #4b5563; /* Gray-600 */
    border-radius: 0.375rem;
    background-color: #374151; /* Gray-700 */
    color: #f3f4f6; /* Light text */
    transition: border-color 0.2s;
}

.management-section input[type="text"]:focus,
#technicalNotesInput:focus,
#pinInput:focus {
    border-color: #3b82f6; /* Blue-500 on focus */
    outline: none;
}

/* Specific styling for the textarea height */
#technicalNotesInput {
    height: 10rem; /* Consistent height */
    resize: vertical; /* Allow vertical resizing only */
}

/* Disabled State for PIN lock */
#technicalNotesInput:disabled,
#saveTechnicalNotesBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #1f2937; /* Darker background when locked */
}


.action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s, opacity 0.2s;
    cursor: pointer;
    border: none;
    color: white;
}

.btn-add {
    background-color: #10b981; /* Emerald-500 */
}

.btn-add:hover {
    background-color: #059669; /* Emerald-600 */
}

.btn-remove {
    background-color: #f97316; /* Orange-500 */
}

.btn-remove:hover {
    background-color: #ea580c; /* Orange-600 */
}

/* Help Me Page Specific Styles */
#helpMePage select {
    padding: 0.75rem 1rem;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background-color: #374151;
    color: #f3f4f6;
    appearance: none; /* Hide default arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
    cursor: pointer;
}

#troubleshootingResult {
    padding: 1rem;
    background-color: #374151;
    border-radius: 0.5rem;
    line-height: 1.6;
}

#troubleshootingResult p, #troubleshootingResult ul, #troubleshootingResult ol {
    margin-bottom: 1rem;
}

#troubleshootingResult .quick-answer {
    font-weight: bold;
    color: #60a5fa; /* Blue-400 */
}

#troubleshootingResult .section-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    color: #fde047; /* Yellow-300 */
    border-bottom: 1px solid #4b5563;
    padding-bottom: 0.25rem;
    margin-top: 1rem;
}

#troubleshootingResult ul, #troubleshootingResult ol {
    padding-left: 2rem;
}

#troubleshootingResult li {
    margin-bottom: 0.5rem;
}

/* --- SLIDESHOW STYLES --- */

/* Ensure the modal content is relative and has dynamic background transition */
#slideshowModal #slideshowContent {
    position: relative; 
    transition: background-color 0.5s, border-color 0.5s; 
}

/* The fixed timer text */
#slideshowModal #slideTimer {
    font-size: 2.5rem; 
    font-weight: 800; 
    color: #facc15; 
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5); 
}

/* The absolute image container */
#slideImageContainer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem; 
}

/* Button size fix for absolute positioning */
#slideshowModal #nextSlideBtn,
#slideshowModal #skipSlideshowBtn {
    font-size: 1.25rem; 
    padding: 0.75rem 1.5rem; 
}