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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #8b8b8b 0%, #6d6d6d 100%);
    min-height: 100vh;
    padding: 20px;
}

/* AUTHENTICATION STYLES */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #7a7a7a 0%, #6a6a6a 100%);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
    color: white;
    font-size: 32px;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form.hidden {
    display: none;
}

.auth-form h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 10px;
}

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

.auth-form label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.auth-form input {
    padding: 10px 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(100, 200, 255, 0.8);
}

.auth-btn {
    padding: 12px;
    background: rgba(100, 200, 255, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.auth-btn:hover {
    background: rgba(100, 200, 255, 1);
}

.toggle-form {
    text-align: center;
    margin-top: 10px;
}

.toggle-form p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.toggle-form a {
    color: rgba(100, 200, 255, 1);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.toggle-form a:hover {
    text-decoration: underline;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

#mainApp.hidden {
    display: none;
}

.logout-btn {
    background: rgba(255, 100, 100, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin-left: 8px;
    display: none;
}

.logout-btn:hover {
    background: rgba(255, 100, 100, 1);
}

/* Profile Dropdown */
.user-profile {
    position: relative;
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(100, 200, 255, 0.9);
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
    margin-top: 8px;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.dropdown-item:hover {
    background-color: rgba(80, 180, 255, 0.8);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 40px);
}

.hidden {
    display: none !important;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 300px;
    background: linear-gradient(135deg, #7a7a7a 0%, #6a6a6a 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: white;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    color: white;
    font-size: 14px;
}

.profile-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 20px;
}

.welcome-section h2 {
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
}

.welcome-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.progress-section {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.progress-arc {
    position: relative;
    width: 120px;
    height: 120px;
}

#progressCanvas {
    display: block;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.percentage {
    display: block;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.fraction {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.todo-section {
    margin: 25px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.todo-section h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 16px;
    text-decoration: underline;
    letter-spacing: 1px;
    font-weight: 600;
}

.todo-section ol {
    list-style: decimal inside;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    line-height: 2;
    padding: 0 10px;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.todo-section li {
    margin-bottom: 10px;
    font-weight: 500;
}

.todo-section .todo-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.todo-section .todo-item:hover {
    color: rgba(100, 200, 255, 0.9);
    text-decoration: underline;
    transform: translateX(5px);
}

/* CALENDAR STYLING */
.calendar-section {
    flex: 1;
    background: linear-gradient(135deg, #7a7a7a 0%, #6a6a6a 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

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

.calendar-header h2 {
    color: white;
    font-size: 28px;
    letter-spacing: 3px;
    flex: 1;
    text-align: center;
}

.calendar-header button {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background: rgba(0, 0, 0, 0.3);
}

.calendar-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.weekday {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    padding: 8px 0;
}

.dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.date-cell {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.date-cell:hover {
    background: rgba(0, 0, 0, 0.3);
}

.date-cell.today {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.6);
    color: white;
    font-weight: bold;
}

.date-cell.has-task {
    background: rgba(100, 180, 200, 0.4);
}

.date-cell.empty {
    background: transparent;
    cursor: default;
}

/* ADD WORK SECTION */
.add-work-section {
    width: 300px;
    background: linear-gradient(135deg, #7a7a7a 0%, #6a6a6a 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.add-work-section h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

#addWorkForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

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

.form-group label {
    color: white;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
    color: white;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 200, 255, 0.5);
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
}

.submit-btn {
    margin-top: auto;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
}

.submit-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

/* DAY VIEW SECTION */
.day-view-section {
    width: 300px;
    background: linear-gradient(135deg, #7a7a7a 0%, #6a6a6a 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.day-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.day-view-header h2 {
    color: white;
    font-size: 20px;
    flex: 1;
}

.back-btn {
    background: rgba(100, 200, 255, 0.3);
    border: 2px solid rgba(100, 200, 255, 0.5);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(100, 200, 255, 0.5);
}

.tasks-list {
    flex: 1;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
}

.task-item {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid rgba(100, 200, 255, 0.6);
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.task-item:not(.completed):hover {
    background: rgba(0, 200, 0, 0.6);
    border-left-color: rgba(0, 200, 0, 0.8);
}

.task-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-item.completed:hover {
    background: rgba(255, 0, 0, 0.6);
    border-left-color: rgba(255, 0, 0, 0.8);
    opacity: 1;
}

.task-action-btn {
    display: none;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.task-item:not(.completed):hover .task-action-btn {
    display: block;
}

.task-item.completed:hover .task-action-btn {
    display: block;
}

.task-item-subject {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.task-item-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.task-item-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 30px 15px;
    font-size: 14px;
}

.add-task-btn {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
}

.add-task-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar,
    .calendar-section,
    .add-work-section,
    .day-view-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .calendar-section,
    .add-work-section,
    .day-view-section {
        width: 100%;
    }

    .header h1 {
        font-size: 20px;
    }

    .calendar-header h2 {
        font-size: 22px;
    }
}