:root {
    /* Color Palette - Intuitive & Categorized */
    --primary: #3b82f6;
    /* Blue for Dashboard */
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #a855f7;
    /* Purple for Calendar */
    --accent: #10b981;
    /* Green for Tasks */
    --notes-color: #f59e0b;
    /* Amber for Notes */
    --background: #0b0f1a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(51, 65, 85, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.4;
}

/* Layout */
#app {
    max-width: 500px;
    margin: 0 auto;
    padding: env(safe-area-inset-top, 20px) 16px calc(100px + env(safe-area-inset-bottom, 20px)) 16px;
    min-height: 100vh;
    width: 100%;
}

@media (max-width: 480px) {
    #app {
        padding: env(safe-area-inset-top, 16px) 12px calc(90px + env(safe-area-inset-bottom, 16px)) 12px;
    }

    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .temp {
        font-size: 2rem;
    }
}

header {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.translator-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    transition: all 0.3s;
}

.translator-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Cards & Glassmorphism */
.glass {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card {
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:active {
    transform: scale(0.98);
}

.dashboard-grid {
    display: grid;
    gap: 16px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Module Themes */
.card-ai {
    border-top: 3px solid var(--primary);
}

.card-weather {
    border-top: 3px solid var(--primary);
}

.card-history {
    border-top: 2px solid var(--secondary);
}

.card-links {
    border-top: 3px solid var(--secondary);
}

.card-notes {
    border-top: 3px solid var(--notes-color);
}

.card-tasks {
    border-top: 3px solid var(--accent);
}

/* Specific Modules */
.weather-widget {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.temp {
    font-size: 2.5rem;
    font-weight: 700;
}

.history-item {
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--primary);
}

/* Tasks */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.task-image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: 10px;
    border: 1px solid var(--glass-border);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
}

.priority-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.priority-alta {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.priority-media {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.priority-baja {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Bottom Controls */
.nav-bar {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    height: 70px;
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 5px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.nav-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    cursor: pointer;
}

.nav-item {
    color: var(--text-muted);
    font-size: 1.3rem;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary);
    transform: scale(1.1);
}

.fab {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px var(--primary-glow);
    margin-top: -40px;
    border: 4px solid var(--background);
    cursor: pointer;
}

/* Calendar */
.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 15px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day.today {
    background: var(--primary);
    color: white;
    font-weight: 800;
}

.calendar-day.selected {
    border: 2px solid var(--secondary) !important;
    background: rgba(168, 85, 247, 0.2);
}

.calendar-day.other-month {
    color: #334155;
}

/* Links Grid - Folder Style */
.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.link-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 8px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: white;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.delete-link-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--danger);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    z-index: 10;
}

.link-card:hover .delete-link-btn {
    opacity: 1;
}

.delete-link-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.link-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.link-card span {
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--background);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--glass-border);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px;
    color: white;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    width: 100%;
    font-weight: 600;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.4s ease forwards;
}

.recording-active {
    color: var(--danger) !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.voice-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    z-index: 3000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}