/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.header-content h1 i {
    margin-right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 150px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.stat-card i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-card h3 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card h3 i {
    color: #667eea;
}

/* Progress Circle */
.progress-overview {
    position: relative;
    text-align: center;
}

.progress-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.progress-label {
    color: #666;
    font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.action-btn.tertiary {
    background: linear-gradient(135deg, #fc466b, #3f5efb);
    color: white;
    box-shadow: 0 4px 15px rgba(252, 70, 107, 0.4);
}

.action-btn.quaternary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Activity List */
.activity-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.activity-icon.completed {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.activity-icon.missed {
    background: linear-gradient(135deg, #fc466b, #3f5efb);
}

.activity-text h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.activity-text p {
    font-size: 0.85rem;
    color: #666;
}

/* Today's Habits */
.today-habits {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.today-habits h3 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.habit-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    transition: all 0.3s ease;
    cursor: pointer;
}

.habit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.habit-card.completed {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1), rgba(56, 239, 125, 0.1));
    border-left-color: #11998e;
}

.habit-card.incomplete {
    border-left-color: #fc466b;
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.habit-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.habit-category {
    font-size: 0.85rem;
    color: #666;
}

.habit-status {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.habit-status.completed {
    background: #11998e;
    border-color: #11998e;
    color: white;
}

.habit-progress {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.habit-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    transition: width 0.3s ease;
}

.habit-streak {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Habits Management */
.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.habits-header h2 {
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.habits-list {
    display: grid;
    gap: 20px;
}

.habit-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: between;
    align-items: center;
    border-left: 4px solid;
}

.habit-info {
    flex: 1;
}

.habit-info h4 {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.habit-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.habit-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #888;
}

.habit-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-delete {
    background: #fc466b;
    color: white;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.stat-title {
    color: #666;
    font-size: 0.9rem;
}

/* Calendar */
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-header button {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
}

.calendar-day.header {
    font-weight: 600;
    color: #667eea;
    cursor: default;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.calendar-day:hover:not(.header) {
    background: rgba(102, 126, 234, 0.1);
}

.calendar-day-number {
    font-weight: 500;
    margin-bottom: 5px;
}

.calendar-progress {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: #ddd;
    overflow: hidden;
}

.calendar-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    transition: width 0.3s ease;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #333;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

/* Form Styles */
form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.days-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.days-selector label {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal;
}

.days-selector label:hover {
    background: #e9ecef;
}

.days-selector input[type="checkbox"] {
    width: auto;
}

.days-selector input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    background: linear-gradient(135deg, #fc466b, #3f5efb);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .header-stats {
        flex-direction: column;
        width: 100%;
    }

    .stat-card {
        justify-content: center;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .habits-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        min-height: 60px;
        font-size: 0.9rem;
    }

    .habits-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .habit-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .nav-tab {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Hover Effects */
.habit-card:hover .habit-status:not(.completed) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.calendar-day.has-progress {
    border: 2px solid rgba(17, 153, 142, 0.3);
}

/* Category Colors */
.habit-card[data-category="health"] {
    border-left-color: #ff6b6b;
}

.habit-card[data-category="productivity"] {
    border-left-color: #4ecdc4;
}

.habit-card[data-category="learning"] {
    border-left-color: #45b7d1;
}

.habit-card[data-category="mindfulness"] {
    border-left-color: #96ceb4;
}

.habit-card[data-category="social"] {
    border-left-color: #feca57;
}

.habit-card[data-category="creativity"] {
    border-left-color: #ff9ff3;
}

.habit-card[data-category="other"] {
    border-left-color: #54a0ff;
}