:root {
    --razer-green: #44d62c;
    --razer-dark: #050505;
    --razer-grey: #1a1a1a;
    --text-main: #ffffff;
    --text-dim: #888888;
    --glow: 0 0 10px rgba(68, 214, 44, 0.5);
    --border-color: #333;
}

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

body {
    background-color: var(--razer-dark);
    color: var(--text-main);
    font-family: 'Outfit',
        sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Typography & Header */
.glow-text {
    text-shadow: var(--glow);
    color: var(--razer-green);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--razer-green);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 15px rgba(68, 214, 44, 0.1);
}

.main-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.month-nav h2 {
    font-family: 'Orbitron', sans-serif;
    min-width: 200px;
    text-align: center;
}

.month-nav button {
    background: transparent;
    border: 1px solid var(--razer-green);
    color: var(--razer-green);
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.month-nav button:hover {
    background: var(--razer-green);
    color: #000;
    box-shadow: var(--glow);
}

/* Calendar Container */
.calendar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.graph-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    width: 100%;
}

.canvas-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', sans-serif;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* Auto rows to fill space */
    grid-auto-rows: 1fr;
    gap: 2px;
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--border-color);
    /* Gap color */
}

.day-cell {
    background: var(--razer-dark);
    padding: 0.5rem;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align for text */
    justify-content: flex-start;
    overflow: hidden;
    /* Hide overflow */
}

.day-cell:hover {
    background: #111;
    border: 1px solid var(--razer-green);
    z-index: 1;
}

.day-cell.today {
    background: rgba(68, 214, 44, 0.05);
}

.day-cell.today .day-num {
    color: var(--razer-green);
    font-weight: bold;
    text-shadow: 0 0 5px var(--razer-green);
}

.day-num {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    font-weight: bold;
}

/* Indicators -> Content Previews */
.preview-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.preview-item {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.preview-item.diary-prev {
    color: #aeaeae;
    border-left: 2px solid #fff;
}

.preview-item.gym-prev {
    color: var(--razer-green);
    border-left: 2px solid var(--razer-green);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--razer-grey);
    border: 2px solid var(--razer-green);
    box-shadow: 0 0 30px rgba(68, 214, 44, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 8px;
    /* Slight round */
    position: relative;
    color: #fff;
}

.modal-content.hidden,
.modal-overlay.hidden {
    display: none;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
}

.close-btn:hover {
    color: #fff;
}

.modal-tabs {
    display: flex;
    margin: 1.5rem 0;
    border-bottom: 1px solid #333;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--razer-green);
    border-bottom: 2px solid var(--razer-green);
    text-shadow: var(--glow);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Inputs & Forms */
textarea {
    width: 100%;
    height: 150px;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
    resize: none;
    outline: none;
    margin-bottom: 1rem;
}

textarea:focus,
.neon-input:focus {
    border-color: var(--razer-green);
    box-shadow: var(--glow);
}

.neon-input {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 0.8rem;
    width: 100%;
    margin-bottom: 0.5rem;
    outline: none;
}

.action-btn {
    width: 100%;
    background: var(--razer-green);
    color: #000;
    font-weight: bold;
    padding: 1rem;
    border: none;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

.history-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #333;
    padding-top: 1rem;
}

.log-item {
    background: #111;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 2px solid var(--razer-green);
    font-size: 0.9rem;
}

/* Gym Chips */
.gym-chip {
    display: inline-block;
    border: 1px solid #333;
    color: #aeaeae;
    padding: 6px 12px;
    border-radius: 16px;
    /* Pill shape */
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #111;
}

.gym-chip:hover {
    border-color: var(--razer-green);
    color: #fff;
}

.gym-chip.selected {
    background: var(--razer-green);
    color: #000;
    font-weight: bold;
    border-color: var(--razer-green);
    box-shadow: var(--glow);
}

/* Scrollbar for Chips area */
#modal-gym-chips {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 1rem;
}

#modal-gym-chips::-webkit-scrollbar {
    width: 4px;
}

#modal-gym-chips::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* Edit/Delete Buttons */
.sm-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 4px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
}

.sm-btn:hover {
    color: #fff;
    border-color: #fff;
}

.edit-btn:hover {
    color: var(--razer-green);
    border-color: var(--razer-green);
    box-shadow: var(--glow);
}

.delete-btn:hover {
    color: #ff4757;
    border-color: #ff4757;
    box-shadow: 0 0 5px rgba(255, 71, 87, 0.5);
}

/* Mobile */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 5px;
    }

    .day-cell {
        min-height: 80px;
        /* Reduced height */
        padding: 5px;
    }

    .day-num {
        font-size: 0.9rem;
        /* Smaller date */
    }

    .preview-item {
        font-size: 0.65rem;
        /* Much smaller preview text */
        padding: 1px 4px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    #current-month-title {
        font-size: 1.2rem;
    }

    .month-nav button {
        padding: 5px 10px;
        font-size: 0.9rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    /* Adjust Modal tabs for mobile */
    .modal-tabs {
        justify-content: center;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    /* Graph container height adjust */
    .graph-section {
        height: auto;
    }

    /* Top Bar Gym Input */
    #pane-gym div[style*="border-bottom"] {
        flex-wrap: wrap;
    }
}