:root {
    /* Tema Oscuro (por defecto) */
    --bg-primary: #1a1a2e;
    --bg-secondary: #0f0f1c;
    --bg-card: #2a2a4a;
    --bg-card-hover: #4a4a6a;
    --bg-list-item: #3a3a5a;
    --text-primary: #e0e0e0;
    --text-secondary: #8899aa;
    --text-accent: #00e6e6;
    --text-accent-hover: #66ffff;
    --border-accent: #00c2c2;
    --shadow-glow: rgba(0, 255, 255, 0.2);
    --shadow-strong: rgba(0, 255, 255, 0.4);
    --card-weather-bg: #003333;
    --card-weather-border: #006666;
    --card-weather-highlight: #004d4d;
    --forecast-item-bg: #2a2a4a;
    --forecast-item-border: #4a4a7a;
}

[data-theme="light"] {
    /* Tema Claro */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #e8e8e8;
    --bg-list-item: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-accent: #0066cc;
    --text-accent-hover: #0052a3;
    --border-accent: #0066cc;
    --shadow-glow: rgba(0, 102, 204, 0.15);
    --shadow-strong: rgba(0, 102, 204, 0.25);
    --card-weather-bg: #e3f2fd;
    --card-weather-border: #90caf9;
    --card-weather-highlight: #bbdefb;
    --forecast-item-bg: #f5f5f5;
    --forecast-item-border: #e0e0e0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.dashboard-container {
    max-width: 95%;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 20px var(--shadow-glow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
/* Clase para el ancho del 95% */
.container-95-percent {
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
}
h1 {
    font-size: 1.8rem;
    color: var(--text-accent);
    text-shadow: 0 0 8px var(--shadow-strong);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
h2 {
    font-size: 1.3rem;
    color: var(--text-accent);
    text-shadow: 0 0 8px var(--shadow-strong);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
h5 {
    font-size: 1.0rem;
    color: var(--text-accent);
    text-shadow: 0 0 8px var(--shadow-strong);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h5 {
    text-shadow: none;
}
.card-custom .card-body p, 
.card-custom .card-body small,
.card-custom .list-group-item {
    font-size: 0.75rem; /* Reducir tamaño de texto dentro de tarjetas y listas */
}
.card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    box-shadow: 0 0 10px var(--shadow-glow);
    transition: transform 0.2s ease-in-out, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card-custom:hover {
    transform: translateY(-5px);
}
.card-header {
    background-color: #007bff;
    border-bottom: 1px solid var(--border-accent);
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    padding: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.card-notion .card-header {
    background-color: #ff7a00;
    border-bottom: 1px solid #ffa500;
}
[data-theme="light"] .card-notion .card-header {
    background-color: #ff9a40;
}
.card-weather .card-header {
    background-color: var(--card-weather-bg);
    border-bottom: 1px solid var(--card-weather-border);
}
.today-weather-highlight {
    background-color: var(--card-weather-highlight);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--text-accent);
    box-shadow: 0 0 15px var(--shadow-strong);
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.today-weather-highlight h5 {
    font-size: 1.5rem; /* Título más grande para hoy */
    margin-bottom: 10px;
}
.today-weather-icon {
    width: 60px; /* Icono mucho más grande para hoy */
    height: 60px;
    vertical-align: middle;
}
.forecast-item {
    background-color: var(--forecast-item-bg);
    border: 1px solid var(--forecast-item-border);
    border-radius: 5px;
    margin-bottom: 5px;
    padding: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.card-weather .card-body h5, 
.card-weather .card-body p, 
.card-weather .card-body strong, 
.card-weather .card-body small, 
.card-weather .card-body .text-muted {
    color: #ffffff !important; /* Asegura que todo el texto dentro del cuerpo del clima sea blanco */
}
/* Estilo para el Daily Briefing IA */
.card-daily-briefing .card-body {
    max-height: 300px; /* Ajusta la altura máxima según sea necesario */
    overflow-y: auto; /* Habilita el scroll vertical */
}
.card-daily-briefing .card-body p, 
.card-daily-briefing .card-body h2,
.card-daily-briefing .card-body h3,
.card-daily-briefing .card-body h4,
.card-daily-briefing .card-body h5,
.card-daily-briefing .card-body ul,
.card-daily-briefing .card-body li,
.card-daily-briefing .card-body strong {
    color: #e0e0e0; /* Color de texto claro para todos los elementos del briefing */
}
.list-group-item {
    background-color: var(--bg-list-item);
    border-color: var(--forecast-item-border);
    color: var(--text-primary);
    margin-bottom: 3px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}
.list-group-item:hover {
    background-color: var(--bg-card-hover);
}
.text-muted {
    color: var(--text-secondary) !important;
}
a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--text-accent-hover);
    text-decoration: underline;
}
.btn-outline-secondary {
    color: var(--text-accent);
    border-color: var(--text-accent);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-outline-secondary:hover {
    background-color: var(--text-accent);
    color: var(--bg-primary);
}
.weather-icon {
    vertical-align: middle;
    margin-left: 8px; /* Aumento ligeramente el margen para separación */
    width: 24px; /* Un poco más grande para mejor visibilidad */
    height: 24px; /* Un poco más grande para mejor visibilidad */
}
.card-bdl .card-header {
    background-color: #007bff;
    border-bottom: 1px solid var(--border-accent);
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    padding: 10px;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--bg-card);
    border: 2px solid var(--border-accent);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 0 15px var(--shadow-glow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--shadow-strong);
}
.theme-toggle-icon {
    font-size: 1.4rem;
}

/* Loading skeleton animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}
.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

/* Card animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-custom {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation delays for cards */
.row:nth-child(1) .card-custom {
    animation-delay: 0.1s;
}
.row:nth-child(2) .card-custom:nth-child(1) {
    animation-delay: 0.2s;
}
.row:nth-child(2) .card-custom:nth-child(2) {
    animation-delay: 0.3s;
}
.row:nth-child(3) .card-custom:nth-child(1) {
    animation-delay: 0.4s;
}
.row:nth-child(3) .card-custom:nth-child(2) {
    animation-delay: 0.5s;
}
.row:nth-child(4) .card-custom:nth-child(1) {
    animation-delay: 0.6s;
}
.row:nth-child(4) .card-custom:nth-child(2) {
    animation-delay: 0.7s;
}

/* Loading state for content */
.content-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.content-loaded {
    opacity: 1;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Pulse animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Progress bar for refresh timer */
.refresh-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--bg-card);
    z-index: 9999;
}

.refresh-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--text-accent), var(--text-accent-hover));
    width: 0%;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--text-accent);
}

/* Smooth transitions for dynamic content */
.dynamic-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects enhancement */
.card-custom {
    position: relative;
    overflow: hidden;
}

.card-custom::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--shadow-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-custom:hover::before {
    opacity: 0.3;
}

/* List item entrance animations */
.list-group-item {
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification-enter {
    animation: slideInRight 0.5s ease-out;
}

.notification-exit {
    animation: slideOutRight 0.5s ease-out;
}

/* Spinner for loading states */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--bg-card-hover);
    border-top-color: var(--text-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

/* Button ripple effect */
button, .btn {
    position: relative;
    overflow: hidden;
}

button::after, .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after, .btn:active::after {
    width: 300px;
    height: 300px;
}
