* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 110px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 70px 0 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo .logo-full {
    height: 90px;
}

.logo .logo-icon {
    height: 60px;
}

.logo img {
    transition: opacity 0.3s ease;
}

.header.sidebar-collapsed .logo {
    margin-left: -40px;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: 0.3s;
}

.menu-toggle svg {
    width: 36px;
    height: 36px;
    stroke: #0088cc;
    stroke-width: 2.5;
}

.menu-toggle:hover {
    background: #f0f5f8;
    border-radius: 6px;
}

.header-buttons {
    display: flex;
    gap: 25px;
    align-items: center;
}

.auth-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-login {
    background: #0088cc;
    color: white;
    border: none;
    padding: 15px 42px;
    border-radius: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: 0.3s;
}

.btn-login:hover {
    background: #0077b3;
}

.btn-register {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px 42px;
    border-radius: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: 0.3s;
}

.btn-register:hover {
    background: #5a6268;
}

/* Texto de botones responsive */
.btn-text-short {
    display: none;
}

.btn-text-full {
    display: inline;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 110px;
    width: 320px;
    height: calc(100vh - 110px);
    background: #f8f9fa;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 0;
    z-index: 999;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .nav-item span {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 25px 18px 30px;
    color: #7a7a7a;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.nav-item span {
    transition: opacity 0.3s ease, width 0.3s ease;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s;
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    background: #eff2f5;
}

.nav-item.active {
    color: #0088cc;
    background: #e8f4f8;
}

.nav-item.active .nav-indicator {
    background: #0088cc;
}

.icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke-width: 2.2;
}

.sidebar-footer {
    padding: 0 25px;
    font-size: 10px;
    color: #b0b0b0;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

/* Main Content */
.main-content {
    margin-left: 320px;
    margin-top: 110px;
    min-height: calc(100vh - 110px);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 80px;
}

.hero-section {
    position: relative;
    width: 100%;
    height: calc(100vh - 110px);
    overflow: hidden;
}

.hero-image {
    width: auto;
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.1) 70%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 120px;
    left: 80px;
    z-index: 2;
    max-width: 600px;
}

.hero-content h1 {
    color: white;
    font-size: 56px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 35px;
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.5px;
}

.btn-primary {
    background: #0088cc;
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 28px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 500;
    transition: 0.3s;
    box-shadow: 0 3px 12px rgba(0, 136, 204, 0.35);
}

.btn-primary:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 136, 204, 0.45);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
        height: 70px;
    }

    .header-left {
        gap: 15px;
    }

    .logo .logo-full {
        height: 50px;
    }

    .logo .logo-icon {
        height: 45px;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    .menu-toggle svg {
        width: 28px;
        height: 28px;
    }

    .header-buttons {
        gap: 12px;
    }

    .btn-login,
    .btn-register {
        padding: 12px 24px;
        font-size: 14px;
        border-radius: 24px;
    }
    
    .btn-text-short {
        display: inline;
    }
    
    .btn-text-full {
        display: none;
    }

    .hero-content {
        left: 25px;
        right: 25px;
        top: 80px;
        max-width: none;
    }

    .hero-content h1 {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .btn-primary {
        padding: 13px 30px;
        font-size: 15px;
    }

    .sidebar {
        top: 70px;
        height: calc(100vh - 70px);
        width: 280px;
    }

    .main-content {
        margin-top: 70px;
        min-height: calc(100vh - 70px);
    }

    .hero-section {
        height: calc(100vh - 70px);
    }

    .cursos-section {
        padding: 25px 15px;
    }

    .top-container {
        margin-bottom: 25px;
    }

    .cursos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
        height: 65px;
    }

    .header-left {
        gap: 10px;
    }

    .logo .logo-full {
        height: 45px;
    }

    .logo .logo-icon {
        height: 40px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .menu-toggle svg {
        width: 24px;
        height: 24px;
    }

    .header-buttons {
        gap: 10px;
    }

    .btn-login,
    .btn-register {
        padding: 10px 18px;
        font-size: 13px;
        border-radius: 22px;
    }

    .hero-content {
        left: 20px;
        right: 20px;
        top: 60px;
    }

    .hero-content h1 {
        font-size: 26px;
        line-height: 1.3;
        margin-bottom: 18px;
    }

    .btn-primary {
        padding: 12px 26px;
        font-size: 14px;
    }

    .sidebar {
        top: 65px;
        height: calc(100vh - 65px);
        width: 260px;
    }

    .main-content {
        margin-top: 65px;
        min-height: calc(100vh - 65px);
    }

    .hero-section {
        height: calc(100vh - 65px);
    }

    .cursos-section {
        padding: 20px 12px;
    }

    .curso-info {
        padding: 16px 18px 18px 18px;
    }

    .curso-info h3 {
        font-size: 12px;
    }

    .instructor {
        font-size: 11px;
    }

    .btn-ver-mas {
        padding: 8px 20px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 0 10px;
        height: 60px;
    }

    .logo .logo-full {
        height: 40px;
    }

    .logo .logo-icon {
        height: 35px;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
    }

    .menu-toggle svg {
        width: 22px;
        height: 22px;
    }

    .btn-login,
    .btn-register {
        padding: 7px 12px;
        font-size: 11px;
    }

    .hero-content h1 {
        font-size: 22px;
    }

    .btn-primary {
        padding: 10px 22px;
        font-size: 13px;
    }

    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .main-content {
        margin-top: 60px;
        min-height: calc(100vh - 60px);
    }

    .hero-section {
        height: calc(100vh - 60px);
    }
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #d0d0d0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

.modal-header {
    text-align: center;
    margin-bottom: 35px;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-header p {
    color: #7a7a7a;
    font-size: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #7a7a7a;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0088cc;
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.toggle-password:hover {
    background: #e0e0e0;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    stroke: #666;
}

.btn-submit {
    background: #22c55e;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #16a34a;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.modal-footer p {
    color: #7a7a7a;
    font-size: 14px;
    margin-bottom: 10px;
}

.link-register {
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
}

.link-register:hover {
    text-decoration: underline;
}

.link-forgot {
    color: #7a7a7a;
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* Cursos Section */
.cursos-section {
    padding: 40px 60px;
    background: #f5f5f5;
    min-height: calc(100vh - 110px);
}

.top-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

.banner-publicidad {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.banner-publicidad img {
    width: 100%;
    height: auto;
    display: block;
}

.categorias-sidebar {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.categorias-sidebar h2 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
}

.curso-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 380px;
}

.curso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.curso-image {
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 220px;
    overflow: hidden;
    position: relative;
    background: white;
    display: flex;
    align-items: flex-start;
}

.curso-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 60%, rgba(255, 255, 255, 0.85) 100%);
    pointer-events: none;
}

.curso-image img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: center top;
    display: block;
}

.curso-info {
    padding: 18px 20px 20px 20px;
}

.curso-info h3 {
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.instructor {
    color: #6b6b6b;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.instructor strong {
    font-weight: 700;
    color: #4a4a4a;
}

.btn-ver-mas {
    background: #0088cc;
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: auto;
    display: inline-block;
}

.btn-ver-mas:hover {
    background: #0077b3;
}

/* Responsive Cursos */
@media (max-width: 1200px) {
    .top-container {
        grid-template-columns: 1fr;
    }

    .categorias-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .cursos-section {
        padding: 30px 20px;
    }

    .cursos-grid {
        grid-template-columns: 1fr;
    }

    .top-container {
        margin-bottom: 30px;
        gap: 20px;
    }

    .banner-publicidad {
        border-radius: 10px;
    }

    .categorias-sidebar {
        padding: 20px;
        border-radius: 10px;
    }

    .categorias-sidebar h2 {
        font-size: 18px;
    }

    .curso-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .cursos-section {
        padding: 20px 15px;
    }

    .top-container {
        gap: 15px;
        margin-bottom: 20px;
    }

    .banner-publicidad {
        border-radius: 8px;
    }

    .categorias-sidebar {
        padding: 16px;
        border-radius: 8px;
    }

    .categorias-sidebar h2 {
        font-size: 16px;
    }

    .curso-card {
        border-radius: 12px;
    }

    .curso-image {
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }

    .curso-image img {
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: cover;
        object-position: center top;
    }

    .curso-info {
        padding: 16px 18px 18px 18px;
    }

    .curso-info h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .instructor {
        font-size: 11px;
        margin-bottom: 14px;
    }

    .btn-ver-mas {
        padding: 8px 20px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .cursos-section {
        padding: 15px 10px;
    }

    .top-container {
        gap: 12px;
        margin-bottom: 15px;
    }

    .categorias-sidebar {
        padding: 14px;
    }

    .categorias-sidebar h2 {
        font-size: 15px;
    }

    .curso-card {
        border-radius: 10px;
    }

    .curso-image {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }

    .curso-image img {
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: cover;
        object-position: center top;
    }

    .curso-info {
        padding: 14px 16px 16px 16px;
    }

    .curso-info h3 {
        font-size: 11px;
    }

    .instructor {
        font-size: 10px;
        margin-bottom: 12px;
    }

    .btn-ver-mas {
        padding: 7px 18px;
        font-size: 10px;
    }
}

/* User Dropdown Menu en Campus */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    position: relative;
}

.user-info:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-default svg.avatar-placeholder {
    width: 24px;
    height: 24px;
    stroke: #9ca3af;
}

.user-avatar-default .avatar-img-small {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    transition: transform 0.3s;
}

.user-info:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 4px 8px;
}

.dropdown-item:first-child {
    margin-top: 8px;
}

.dropdown-item:last-child {
    margin-bottom: 8px;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 12px;
}

/* Responsive para el dropdown */
@media (max-width: 768px) {
    .user-dropdown-menu {
        right: -12px;
        min-width: 220px;
    }
    
    .user-details {
        display: none;
    }
}
