/* Toast notification system */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
html,
body {
    min-height: 100vh;
}
}
.toast {
    padding: 12px; /* Reduced from 16px */
    border-radius: 6px; /* Reduced from 8px */
    margin-bottom: 8px; /* Reduced from 10px */
    min-width: 240px; /* Reduced from 280px */
    font-size: 0.875rem; /* Added smaller font size */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateX(100%);
    animation: slideIn 0.2s forwards, fadeOut 0.5s 2s forwards; /* Reduced total duration from 3.3s to 2.2s */
    display: flex;
    align-items: center;
    justify-content: space-between;
}
@keyframes slideIn {
    to { transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; }
}
.success {
    background-color: rgba(4, 120, 87, 0.95);
    color: white;
}
.error {
    background-color: rgba(185, 28, 28, 0.95);
    color: white;
}
.info {
    background-color: rgba(29, 78, 216, 0.95);
    color: white;
}

/* Custom dropdown styling */
.custom-select {
    position: relative;
}
.custom-select .options {
    display: none;
    position: absolute;
    background-color: white;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 100%;
}
.custom-select .option {
    padding: 8px 12px;
    cursor: pointer;
}
.custom-select .option:hover {
    background-color: #f3f4f6;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    input, button, select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        height: 44px; /* More touch-friendly */
    }
    .table-container {
        margin: 0 -16px; /* Negative margin to allow table to be wider than container on mobile */
    }
}

/* Add specific styling for sections datalist */
.section-input-container {
    position: relative;
    width: 100%;
}

/* Footer styling */
.footer {
    background-color: rgba(30, 58, 138, 0.7);
    padding: 8px 0;
    margin-top: 20px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer a {
    color: #fcd34d; /* Yellow color matching the buttons */
}
.footer a:hover {
    color: white;
}

/* Add padding to body to prevent footer overlap */
body {
    padding-bottom: 120px !important; /* Increased padding for more space */
    background-color: #050709;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75)),
        url('../assets/bg.jpg');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    background-attachment: fixed, fixed;
}

/* Small icon styling for note */
.note-icon {
    font-size: 0.6rem;
    margin-right: 1px;
}
.note-button {
    font-size: 0.7rem;
}

/* Input row styling for all screen sizes */
.input-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-bottom: 8px;
    gap: 4px; /* Use gap for consistent spacing */
}
.input-row .course-code {
    flex: 2;
}
.input-row .section {
    flex: 1;
}
.input-row .add-course {
    flex: 1;
}

/* Dropdown improvements */
.dropdown {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    max-height: 12rem;
    overflow-y: auto;
    width: 100%;
    color: #1f2937; /* Add dark text color */
}
.dropdown-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #1f2937; /* Ensure text is visible */
}
.dropdown-option:hover {
    background-color: #fef3c7;
}
.dropdown-option.active {
    background-color: #fde68a;
}
.dropdown-option.disabled {
    color: #9ca3af;
    cursor: default;
}

/* Scrollbar styling */
.dropdown::-webkit-scrollbar {
    width: 6px;
}
.dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
}
.dropdown::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

/* Create proper spacing for the content area */
#capture-area {
    margin-bottom: 50px; /* Increased margin */
}

/* Ensure screenshot button has space above the footer */
#screenshot-btn, #cross-check-btn {
    margin-bottom: 5px; /* Consistent margin */
}

/* Modal styles */
#cross-check-modal {
    transition: opacity 0.3s ease-in-out;
}

/* Canvas container styles */
#pdf-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Improved canvas container for better responsiveness */
.overflow-x-auto {
    overflow-x: auto; /* Standard scrolling */
}

/* Mobile optimizations for modal */
@media (max-width: 640px) {
    #cross-check-modal .max-w-3xl {
        width: 95%;
        max-height: 85vh;
    }
    #pdf-container {
        padding: 0.5rem;
    }
    #pdf-container canvas {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll, scroll;
        background-size: cover, 180%;
    }
}

/* --- Subtle color tuning --- */

#last-update {
    letter-spacing: 0.35em;
    color: #fbbf24;
    font-weight: 600;
}

.course-code,
.section {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background-color: rgba(255, 255, 255, 0.95);
    color: #0f172a !important;
}

.add-course,
#add-more-btn {
    background-color: #facc15 !important;
    color: #1f2937 !important;
    border: none;
}
.add-course:hover,
#add-more-btn:hover {
    background-color: #fde047 !important;
}

#screenshot-btn {
    background-color: #facc15 !important;
    color: #1f2937 !important;
}
#cross-check-btn {
    background-color: #3b82f6 !important;
}
#screenshot-btn:hover {
    background-color: #fde047 !important;
}
#cross-check-btn:hover {
    background-color: #2563eb !important;
}
