/* Base body styling (optional, adjust if Bootstrap overrides) */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f6f8fd 0%, #eef2ff 100%);
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.header-subtitle {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

.back-btn {
    background: linear-gradient(135deg, #475569, #374151);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(71, 85, 105, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.back-btn:hover {
    background: linear-gradient(135deg, #374151, #1f2937);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4);
}

/* Materia Card */
.materia-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    margin-bottom: 2rem;
}

.materia-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.materia-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.materia-card:hover::before {
    opacity: 1;
}

.materia-card.pago-realizado,
.materia-card.pago-pendiente,
.materia-card.disponible {
    border-left: 3px solid #475569;
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.02), rgba(255, 255, 255, 0.95));
}

.materia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.materia-info-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.materia-info-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.materia-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.materia-icon svg {
    width: 28px;
    height: 28px;
    stroke: white; /* Changed from fill to stroke since SVGs use stroke */
}

.materia-info {
    flex: 1;
}

.materia-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
    letter-spacing: -0.015em;
}

.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.estado-badge.pago-realizado {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.estado-badge.pago-pendiente {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.estado-badge.disponible {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.estado-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.precio-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.precio-label {
    color: #64748b;
    font-weight: 500;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.precio-valor {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.materia-descripcion {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.action-button {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 120px;
}

.action-button:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.payment-methods {
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.payment-methods-title {
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.payment-methods-text {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.6;
}

.no-results {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    margin-top: 2rem;
}

.alert.alert-info.alert-permanent {
    background: rgba(219, 234, 254, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #1e40af;
    font-size: 1rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .materia-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .materia-info-right {
        justify-content: space-between;
    }
}

@media (max-width: 1024px) {
    .materia-info-right {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .precio-info {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .materia-card {
        padding: 1.5rem;
    }

    .materia-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .materia-info-left {
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .materia-info-right {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .precio-info {
        align-self: center;
    }

    .action-button {
        min-width: 200px;
        align-self: center;
    }

    .payment-methods {
        text-align: center;
    }
}