/* ==========================================================================
   GID COIB - Main Styles
   ========================================================================== */

:root {
    --primary-color: #007188;
    --primary-dark: #005a6d;
    --primary-light: #e8f4f6;
    --primary-ultralight: #f4fafb;
    --text-color: #000000;
    --text-muted: #9B9A9A;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --white: #fff;
    --sidebar-width: 280px;
    --sidebar-accent: #007188;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

/* Top accent bar - replaces logo */
.sidebar::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--sidebar-accent) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
}

.sidebar-header {
    display: none;
}

.sidebar-logo {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 30px 0 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav li:last-child {
    border-bottom: none;
}

.sidebar-nav a,
.sidebar-nav .nav-item {
    display: block;
    padding: 14px 25px 14px 22px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.sidebar-nav a:hover,
.sidebar-nav .nav-item:hover {
    background-color: var(--primary-ultralight);
    border-left-color: var(--sidebar-accent);
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-nav a:active {
    background-color: var(--primary-light);
}

.sidebar-nav li.active > a,
.sidebar-nav li.active > .nav-item {
    background-color: var(--primary-light);
    border-left-color: var(--sidebar-accent);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav .nav-item.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.sidebar-nav .nav-item.disabled:hover {
    background-color: transparent;
    border-left-color: transparent;
    color: var(--text-muted);
}

/* User greeting in sidebar */
.nav-user-greeting a,
.nav-user-greeting-mobile a {
    color: var(--primary-color);
    font-weight: 500;
}

.nav-user-greeting a i,
.nav-user-greeting-mobile a i {
    margin-right: 8px;
    color: var(--sidebar-accent);
}

.nav-user-greeting,
.nav-user-greeting-mobile {
    border-bottom: 1px solid var(--primary-light) !important;
    margin-bottom: 5px;
}

/* Logout link */
.nav-logout a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-logout a:hover {
    color: var(--primary-color);
    background-color: var(--primary-ultralight);
    border-left-color: var(--sidebar-accent);
}

.nav-logout a i {
    margin-right: 8px;
}

/* Nav icons styling */
.sidebar-nav a i,
.sidebar-nav .nav-item i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.sidebar-nav a:hover i,
.sidebar-nav li.active > a i {
    color: var(--sidebar-accent);
}

/* Mobile logout icon inline */
.nav-item-with-logout {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item-with-logout .nav-item {
    flex: 1;
}

.nav-logout-mobile {
    color: var(--text-muted) !important;
    border-left: none !important;
    flex-shrink: 0;
}

.nav-logout-mobile:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-ultralight) !important;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 40px;
}

/* Limit main content width */
.main-content .container-lg {
    max-width: 1140px;
}

/* Footer container left-aligned */
.footer .container-lg {
    max-width: 1140px;
    margin-left: 0;
    margin-right: auto;
}

/* ==========================================================================
   Cards & Sections
   ========================================================================== */

.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
}

.card-title {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Step number badge */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 10px;
}

/* Estructura page subsections */
.estructura-subsection {
    background-color: var(--light-bg);
    padding: 15px 20px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 3px solid var(--primary-color);
}

.estructura-subsection ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.estructura-subsection ul li {
    margin-bottom: 5px;
}

.estructura-subsection ul li:last-child {
    margin-bottom: 0;
}

.section-title {
    color: #8B4513;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 169, 251, 0.15);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 5px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Form buttons container */
.form-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.btn-secondary {
    background-color: #6c757d;
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: var(--white);
}

.btn-disabled,
.btn:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover,
.btn:disabled:hover {
    background-color: #ccc;
    color: #888;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* ==========================================================================
   Login Section
   ========================================================================== */

#login-section {
    max-width: 450px;
    margin: 0 auto;
}
#user-section {
    max-width: 450px;
    margin: 0 auto;
}

.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links a {
    display: inline-block;
    margin: 5px 10px;
}

.login-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.login-divider span {
    background-color: var(--white);
    padding: 0 15px;
    position: relative;
    color: var(--text-muted);
}

/* ==========================================================================
   Alert Messages
   ========================================================================== */

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #b8e2fb;
}

/* ==========================================================================
   Section Buttons (Com funciona, Estructura, FAQ's)
   ========================================================================== */

.section-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.section-btn {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.section-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 169, 251, 0.15);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 40px;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section:last-child {
    margin-bottom: 0;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.footer-logos {
    max-width: 100%;
    height: auto;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    margin-right: 15px;
    margin-bottom: 10px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-links a {
    margin-right: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Contact Card */
a.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

a.contact-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 169, 251, 0.15);
    text-decoration: none;
}

.contact-card-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.contact-card-content {
    display: flex;
    flex-direction: column;
}

.contact-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.contact-card-email {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.page-header {
    margin-bottom: 30px;
}

.page-title {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 1rem;
}

/* FAQ Section Titles */
.faq-section-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-section-title:first-of-type {
    margin-top: 0;
}

.faq-section-title i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Description Box
   ========================================================================== */

.description-box {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.description-box h2 {
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 0;
    text-align: center;
    font-size: 1.8rem;
}

/* Course Title */
.description-box .course-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Course Image */
.course-image-wrapper {
    margin: -30px -30px 25px -30px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.course-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 350px;
    object-fit: cover;
}

.description-box p {
    line-height: 1.5;
}

.description-box .highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.description-box .lead-text {
    font-weight: 600;
}

.description-box ul {
    line-height: 1.8;
}

/* ==========================================================================
   Mobile Styles
   ========================================================================== */

@media (max-width: 991px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Top accent bar for mobile */
    .sidebar::before {
        height: 3px;
        width: 100%;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-logo {
        display: none;
    }

    .sidebar-nav {
        flex: 1;
        padding: 0;
        width: 100%;
    }

    .sidebar-nav ul {
        display: flex;
        justify-content: flex-end;
        margin: 0;
    }

    .sidebar-nav li {
        margin-bottom: 0;
        border-bottom: none;
    }

    .sidebar-nav a,
    .sidebar-nav .nav-item {
        padding: 14px 18px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .sidebar-nav a:hover,
    .sidebar-nav .nav-item:hover {
        border-left: none;
        border-bottom-color: var(--sidebar-accent);
        background-color: var(--primary-ultralight);
    }

    .sidebar-nav li.active > a {
        border-bottom-color: var(--sidebar-accent);
        background-color: var(--primary-light);
        color: var(--primary-color);
    }

    /* Mobile navigation structure */
    .nav-mobile {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-mobile-row1 {
        display: flex;
        justify-content: flex-end;
        list-style: none;
        margin: 0;
        padding: 8px 12px;
        gap: 5px;
    }

    .nav-mobile-row1 li a,
    .nav-mobile-row1 li .nav-item {
        padding: 10px 16px;
        border-radius: 4px;
        border-bottom: none;
    }

    .nav-mobile-row1 li a:hover {
        background-color: var(--primary-light);
        border-bottom: none;
    }

    .nav-mobile-row2 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 8px 12px;
        border-top: 1px solid var(--primary-light);
        width: 100%;
        background-color: var(--primary-ultralight);
    }

    .nav-mobile-row2 .nav-user-greeting-mobile {
        flex: 1;
        border-bottom: none !important;
        margin-bottom: 0;
    }

    .nav-mobile-row2 .nav-user-greeting-mobile a {
        font-size: 0.85rem;
        text-align: left;
        padding: 6px 10px;
        border-bottom: none;
    }

    .nav-mobile-row2 .nav-logout-mobile a {
        padding: 6px 12px;
        color: var(--text-muted);
        border-bottom: none;
        font-size: 0.85rem;
    }

    .nav-mobile-row2 .nav-logout-mobile a:hover {
        color: var(--primary-color);
        background-color: var(--primary-light);
        border-radius: 4px;
    }

    .main-wrapper {
        flex-direction: column;
    }

    .content-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 20px;
    }

    .section-buttons {
        flex-direction: column;
    }

    .footer {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-logo {
        display: none;
    }

    .sidebar-nav {
        flex: 1;
        padding: 0;
    }

    .sidebar-nav ul {
        width: auto;
        justify-content: flex-end;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    .sidebar-nav a,
    .sidebar-nav .nav-item {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .nav-mobile-row1 {
        padding: 6px 8px;
        gap: 3px;
    }

    .nav-mobile-row1 li a,
    .nav-mobile-row1 li .nav-item {
        padding: 8px 10px;
    }

    .nav-mobile-row2 {
        padding: 6px 10px;
    }

    .nav-mobile-row2 .nav-user-greeting-mobile a {
        font-size: 0.8rem;
        padding: 5px 8px;
    }

    .nav-mobile-row2 .nav-logout-mobile a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .card {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
    }

    .footer-logo {
        max-width: 125px;
    }

    /* Compact description box in mobile */
    .main-content {
        padding: 15px 10px;
    }

    .description-box {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 0;
        box-shadow: none;
    }

    .description-box p {
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .description-box ul {
        line-height: 1.5;
        padding-left: 20px;
        margin-bottom: 10px;
    }

    .description-box h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .description-box .course-title {
        font-size: 1.1rem;
    }

    .course-image-wrapper {
        margin: -15px -15px 20px -15px;
        border-radius: 0;
    }

    .course-image {
        max-height: 200px;
    }

    .login-section {
        padding: 20px 15px;
    }

    /* Contact card full width on mobile */
    a.contact-card {
        width: 100%;
        justify-content: center;
    }

    /* Form buttons stack on mobile */
    .form-buttons {
        flex-direction: column;
    }

    .form-buttons .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Legal Content Styles
   ========================================================================== */

.legal-content {
    max-width: 800px;
    line-height: 1.7;
    color: #333;
}

.legal-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #222;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.75rem;
}

.legal-content h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.legal-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #444;
}

.legal-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-content a {
    color: var(--primary-color);
}

.legal-content a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Cookie Banner Styles
   ========================================================================== */

.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px 25px;
    max-width: 500px;
    width: calc(100% - 40px);
    z-index: 9999;
    font-size: 0.9rem;
}

.cookie-banner-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    color: #222;
}

.cookie-banner-text {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-banner-btn {
    padding: 8px 16px;
    border: 1px solid #333;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.cookie-banner-btn:hover {
    background: #f5f5f5;
}

.cookie-banner-btn.accept {
    background: #333;
    color: #fff;
}

.cookie-banner-btn.accept:hover {
    background: #555;
}

@media (max-width: 480px) {
    .cookie-banner {
        bottom: 10px;
        padding: 15px 20px;
    }
    
    .cookie-banner-buttons {
        flex-direction: column;
    }
    
    .cookie-banner-btn {
        width: 100%;
    }
}

