/* Opin Global Theme Variables */
:root {
    --opin-blue: #28308F;
    --opin-green: #8CC63F;
    --opin-sky: #00AEEF;
    --opin-light: #F8F9FA;
    --opin-dark: #1a1a1a;
    --bs-primary: #28308F;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fcfcfc;
    color: #444;
}

/* Override Bootstrap primary button color */
.btn-primary {
    background-color: #28308F !important;
    border-color: #28308F !important;
}

.btn-primary:hover {
    background-color: #1f256f !important; /* slightly darker */
    border-color: #1f256f !important;
}

.btn-primary:focus, 
.btn-primary:active {
    background-color: #1a1f5c !important;
    border-color: #1a1f5c !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 48, 143, 0.5);
}

/* Alert System */
.opin-alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
}

.opin-alert {
    background: #fff;
    border-left: 5px solid var(--opin-blue);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.5s ease-out;
}

.opin-alert.error {
    border-left-color: #dc3545;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Navigation & Logo */
.navbar {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
}

.logo-container {
    position: relative;
    height: 28px;
    display: inline-block;
}

.logo-container img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: all 2.0s ease-in-out;
}

.logo-main {
    animation: logoFadeMain 12s infinite;
}

.logo-secondary {
    opacity: 0;
    animation: logoFadeSecondary 12s infinite;
}

@keyframes logoFadeMain {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes logoFadeSecondary {
    0%, 45% { opacity: 0; }
    50%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

/* Search & Cards */
.search-container {
    margin-top: 20px; /* Adjust this value for the gap you want */
    position: relative;
    z-index: 10;
}

.search-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    /* Remove any negative margin-top if it exists in your external CSS */
    margin-top: 0 !important; 
}

.course-tile {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid #eee;
    height: 100%;
}

.course-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tile-img {
    height: 160px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

/* Auth Choice Modals */
.choice-card {
    border: 2px solid #eee;
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}

.choice-card:hover {
    border-color: var(--opin-blue);
    background: #f8f9ff;
}

.choice-card i {
    font-size: 3rem;
    color: var(--opin-blue);
    margin-bottom: 15px;
}

/* Buttons */
.btn-signup {
    background-color: var(--opin-blue);
    color: white !important;
    border-radius: 8px;
    font-weight: 600;
}

/* Footer & Overlay Styling */
footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--opin-green) !important;
}

.choice-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-card:hover {
    border-color: var(--opin-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.rounded-4 {
    border-radius: 1rem !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .choice-card {
        padding: 20px !important;
    }
}

/* Full Screen Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 20000; /* Higher than modals and nav */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-content {
    position: relative;
    text-align: center;
}

/* The Spinner Animation */
.opin-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--opin-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Logo pulse in center */
.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-10%, -10%);
    width: 50px;
    animation: pulse 2.0s ease-in-out infinite;
}

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

@keyframes pulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
}

/* Class to hide the loader */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Dashboard Specific Styles */
.stat-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
}

.last-child-no-border:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.timeline-simple {
    max-height: 350px;
    overflow-y: auto;
}

/* Custom Profile Badge in Header */
.badge-student {
    background: var(--opin-sky);
    color: white;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Course Player Enhancements */
.accordion-button:not(.collapsed) {
    background-color: #f8f9ff;
    color: var(--opin-blue);
}

.lesson-btn {
    font-size: 0.9rem;
    transition: all 0.2s;
    background: transparent;
}

.lesson-btn:hover {
    background: #f0f2f5 !important;
    padding-left: 1.5rem !important;
}

.lesson-btn i.fa-play-circle {
    font-size: 0.8rem;
}

#video-container iframe {
    width: 100%;
    height: 100%;
}


/* Validation Styles */
.is-invalid {
    border: 1px solid #dc3545 !important;
    background-color: #fff8f8 !important;
}

.is-valid {
    border: 1px solid var(--opin-green) !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    margin-top: 4px;
    font-size: 0.75rem;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

