/* Basic styling for readability and functionality */
:root {
    --primary-blue: #007bff;
    --primary-hover: #0056b3;
    --success-green: #28a745;
    --success-hover: #218838;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --text-main: #333333;
    --text-muted: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 20px; 
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.header { 
    margin-bottom: 30px; 
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header h1 {
    margin: 0;
}

.header h1 a {
    color: var(--primary-blue);
    transition: var(--transition);
    text-decoration: none;
}

.header h1 a:hover {
    color: var(--primary-hover);
}

.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.planner-form, .controls, .main-content-area > h3, .main-content-area > h2 { 
    margin-bottom: 30px; 
    padding: 25px; 
    background: var(--bg-white);
    border: none;
    border-radius: 12px; 
    box-shadow: var(--shadow);
}

.planner-form h2, .controls h3, .main-content-area > h3, .main-content-area > h2 {
    margin-top: 0;
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: var(--text-main);
}

input[type="text"], 
input[type="date"], 
input[type="url"], 
input[type="password"], 
input[type="email"], 
select, 
textarea { 
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

button { 
    padding: 12px 20px; 
    margin-right: 10px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    background-color: var(--primary-blue); 
    color: white; 
    border: none; 
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.planner-form button {
    display: inline-block;
    width: auto;
}

button:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.create-prof-btn {
    display: inline-block;
    background-color: var(--success-green);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.create-prof-btn:hover {
    background-color: var(--success-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Auth Links Styling */
.auth-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.auth-links a:hover {
    background-color: rgba(0, 123, 255, 0.1);
}
/* Style for the language switch container */
.language-switch { display: none; }

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: #28a745; /* Green for success */
}

.toast.error {
    background-color: #dc3545; /* Red for error */
}

.toast.info {
    background-color: #17a2b8; /* Blue for info */
}

/* Confirmation Toast Specific Styles */
.toast.confirm-toast {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background-color: #ffc107; /* Warning color */
    color: #343a40;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.confirm-btn {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    border: none;
    color: white;
}

.confirm-yes {
    background-color: #28a745; /* Green for Yes */
}

.confirm-yes:hover {
    background-color: #218838;
}

.confirm-no {
    background-color: #dc3545; /* Red for No */
}

.confirm-no:hover {
    background-color: #c82333;
}


/* Saved Plan Indicator Styles */
.saved-plan-indicator {
    background-color: #ffc107; /* Yellowish background for warning/info */
    color: #343a40; /* Dark text */
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.saved-plan-indicator .error-message {
    color: #dc3545; /* Red for error messages within the indicator */
    font-weight: normal;
}

/* Structured Plan Display Styles */
#plan-editor {
    margin-top: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    min-height: 100px; /* Ensure it's visible even when empty */
}

.task-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    border-color: var(--primary-blue);
}

.task-item.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
}

.task-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px; /* Space between main sections */
}

.task-main-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    min-width: 200px; /* Ensure it doesn't get too small */
}

.drag-handle {
    cursor: grab;
    font-size: 1.2em;
    padding: 0 5px;
    color: #888;
}

.drag-handle:active {
    cursor: grabbing;
}

.task-meta-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.task-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.task-time {
    font-weight: 700;
    color: var(--primary-blue);
    min-width: 80px;
    flex-shrink: 0;
}

.task-description {
    flex-grow: 1;
    min-width: 150px;
    font-weight: 500;
}

.task-notes-display {
    font-size: 0.9em;
    color: #555;
    background-color: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
}

.task-reference-link {
    font-size: 0.9em;
    color: #007bff;
    text-decoration: underline;
}

.task-reference-link:hover {
    color: #0056b3;
}

.task-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status specific colors */
.status-planning { background-color: #6c757d; } /* Grey */
.status-on-hold { background-color: #ffc107; color: #333; } /* Yellow */
.status-on-going { background-color: #17a2b8; } /* Blue */
.status-not-completed { background-color: #dc3545; } /* Red */
.status-completed { background-color: #28a745; } /* Green */


.task-edit {
    display: flex;
    flex-direction: column; /* Stack inputs vertically in edit mode */
    gap: 8px;
    margin-top: 10px;
}

.task-edit input[type="text"],
.task-edit input[type="url"],
.task-edit textarea,
.task-edit select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%; /* Full width in edit mode */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.task-edit textarea {
    min-height: 60px;
    resize: vertical;
}

.task-edit .edit-time {
    width: auto; /* Allow time input to be smaller */
    max-width: 100px;
}

.task-edit .edit-status {
    width: auto; /* Allow status select to be smaller */
    max-width: 150px;
}

.edit-task-btn, .delete-task-btn, .save-edit-btn, .cancel-edit-btn {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 5px;
    flex-shrink: 0;
}

.edit-task-btn {
    background-color: #ffc107;
    color: #333;
}

.edit-task-btn:hover {
    background-color: #e0a800;
}

.delete-task-btn {
    background-color: #dc3545;
    color: white;
}

.delete-task-btn:hover {
    background-color: #c82333;
}

.save-edit-btn {
    background-color: #28a745;
    color: white;
}

.save-edit-btn:hover {
    background-color: #218838;
}

.cancel-edit-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-edit-btn:hover {
    background-color: #5a6268;
}

/* Calendar Styles */
.calendar-controls {
    margin-bottom: 20px;
    text-align: center;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 12px;
    background-color: var(--bg-white);
}

.day-header {
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    background-color: var(--bg-light);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.calendar-day, .empty-day {
    padding: 15px 5px;
    text-align: center;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative; /* For marker positioning */
}

.calendar-day:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: var(--primary-blue);
    transform: scale(1.05);
    z-index: 1;
}

.empty-day {
    background-color: #f0f0f0;
    cursor: default;
}

.calendar-day.selected-day {
    border: 2px solid var(--primary-blue);
    background-color: rgba(0, 123, 255, 0.15);
    box-shadow: inset 0 0 0 1px var(--primary-blue);
}

/* Marker Styles */
.calendar-day.marker-1 { background-color: #d4edda; } /* Green */
.calendar-day.marker-2 { background-color: #fff3cd; } /* Yellow */
.calendar-day.marker-3 { background-color: #ffe082; } /* Intense Yellow */
.calendar-day.marker-4 { background-color: #ffc107; } /* Orange */
.calendar-day.marker-5 { background-color: #f8d7da; } /* Red */
.calendar-day.marker-6 { background-color: #dc3545; color: white; } /* Intense Red */

.shortcuts-panel {
    width: 250px;
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
}

.shortcuts-panel h3 {
    margin-top: 0;
    color: var(--primary-blue);
    font-size: 1.2em;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.shortcuts-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcuts-panel li {
    margin-bottom: 10px;
}

.shortcuts-panel li a {
    text-decoration: none;
    color: var(--text-main);
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 500;
}

.shortcuts-panel li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-blue);
    transform: translateX(5px);
}

.shortcut-group h3 {
    font-size: 1.1em;
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--primary-blue);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.convert-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    font-size: 0.9em;
    margin-right: 0;
}

.pdf-btn {
    background-color: #e74c3c;
}

.pdf-btn:hover {
    background-color: #c0392b;
}

.csv-btn {
    background-color: #f39c12; /* Orange for CSV */
}

.csv-btn:hover {
    background-color: #d35400;
}

.excel-btn {
    background-color: #217346;
}

.excel-btn:hover {
    background-color: #1a5a37;
}

.xml-btn {
    background-color: #8e44ad;
}

.xml-btn:hover {
    background-color: #7d3c98;
}

.import-btn {
    background-color: #34495e;
}

.import-btn:hover {
    background-color: #2c3e50;
}

/* Calendar Actions */
.calendar-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.delete-btn i {
    font-size: 1.1rem;
}

.main-layout-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content-area {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

@media (max-width: 900px) {
    body {
        padding: 10px;
        margin: 10px auto;
    }

    .header {
        padding: 15px;
        justify-content: center;
        text-align: center;
    }

    .header-main {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .auth-links {
        width: 100%;
        justify-content: center;
    }

    .user-info {
        text-align: center;
        align-items: center;
    }

    .auth-actions {
        justify-content: center;
    }

    .planner-form, .controls, .main-content-area > h3, .main-content-area > h2 {
        padding: 15px;
    }

    .main-layout-container {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .shortcuts-panel {
        width: 100%;
        position: static;
        margin-bottom: 0;
        box-sizing: border-box;
    }

    .calendar-grid {
        padding: 5px;
        gap: 4px;
    }

    .calendar-day, .empty-day {
        padding: 10px 2px;
        font-size: 0.85em;
    }

    .task-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-meta-info {
        width: 100%;
        justify-content: space-between;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 5px;
    }

    button {
        padding: 14px 20px; /* Larger touch targets */
        width: 100%;
        margin-right: 0;
    }

    .planner-form button {
        width: 100%;
    }

    .create-prof-btn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .calendar-header {
        font-size: 1em;
    }

    .calendar-header button {
        padding: 8px 12px;
        width: auto;
    }
}

html {
    scroll-behavior: smooth;
}
