:root {
    /* Color Palette - Indigo & Light Steel Blue */
    --primary: #2e0c99;
    --primary-dark: #220870;
    --primary-light: #4a1fbd;
    --secondary: #aec8d5;
    --secondary-dark: #8ba9ba;
    --accent: #6b42d6;
    --accent-dark: #5232b5;

    --bg-primary: #0d0320;
    --bg-secondary: #1a0945;
    --bg-tertiary: #250d5c;
    --bg-card: #1c0a42;

    --text-primary: #f0f4ff;
    --text-secondary: #aec8d5;
    --text-muted: #7a8b9c;

    --border: rgba(46, 12, 153, 0.3);
    --border-focus: rgba(174, 200, 213, 0.5);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(46, 12, 153, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Removed decorative radial gradients for a cleaner look */

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(5deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    flex: 1;
}

.title {
    font-family: "Poppins", sans-serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.date-display {
    text-align: right;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.current-date {
    font-family: "Syne", sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 5px;
}

.current-day {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Streak display */
.streak-display {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    justify-content: flex-end;
    align-items: center;
}

.streak-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 12px;
    text-align: center;
    min-width: 100px;
}

.streak-value {
    font-family: "Syne", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
}

.streak-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
section {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out both;
}

.add-habit-section {
    animation-delay: 0.3s;
}

.charts-section {
    animation-delay: 0.5s;
}

.logs-section {
    animation-delay: 0.7s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-family: "Poppins", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

/* Form */
.add-habit-section {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.habit-form {
    margin-top: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.form-group input {
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: "DM Sans", sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    box-shadow: 0 0 0 3px rgba(174, 200, 213, 0.2);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    padding: 14px 32px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: "DM Sans", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    display: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(46, 12, 153, 0.5);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(5px);
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(174, 200, 213, 0.15);
    border: none;
    border-radius: 10px;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: "DM Sans", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--secondary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(174, 200, 213, 0.3);
}

/* Charts */
.charts-section {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.chart-container {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: 16px;
    margin-top: 20px;
}

/* Table */
.logs-section {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: var(--bg-tertiary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: var(--bg-secondary);
}

thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    border-bottom: none;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(46, 12, 153, 0.08);
}

tbody td {
    padding: 16px;
    color: var(--text-primary);
}

.delete-btn {
    padding: 6px 16px;
    background: rgba(174, 200, 213, 0.15);
    border: none;
    border-radius: 8px;
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: var(--secondary);
    color: var(--bg-primary);
    transform: scale(1.05);
}

/* Empty State */
.empty-state {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state.visible {
    display: block;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 25px;
    }

    .date-display {
        width: 100%;
        text-align: center;
    }

    .title {
        font-size: 2.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .logs-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-title {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 12px 8px;
    }
}

/* ApexCharts Custom Styling */
.apexcharts-tooltip {
    background: var(--bg-secondary) !important;
    border: none !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-md) !important;
}

.apexcharts-tooltip-title {
    background: var(--bg-tertiary) !important;
    border-bottom: none !important;
    color: var(--text-secondary) !important;
}
