/* /home/pwttodo/todo.mediapundit.net/css/style.css */

/* General Body Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6; /* Light gray background */
    color: #333;
}

/* Application Header */
.app-header {
    //background-color: #4CAF50; /* A pleasant green */
    color: white;
    /*padding: 20px;*/
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; /* Use flexbox for centering content */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    /*min-height: 80px;*/
    min-height: 5px;
}

/* Style for the new logo image */
.logo-image {
    max-width: 200px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below image */
}

.app-header h1 {
    margin: 0;
    font-size: 2em;
}

/* Main Layout (Flexbox Container) */
.main-layout-wrapper {
    /*width: 1200px;*/
    /*margin: 20px auto;*/
    background-color: #fff; /* White background for the main content area */
    /* border-radius: 8px; */
    /* box-shadow: 0 0 15px rgba(0,0,0,0.08); */ /* Stronger shadow for the main container */
    overflow: hidden; /* Ensures rounded corners are respected by children */
}

/* Apply flexbox properties ONLY when sidebar is present */
.main-layout-wrapper.has-sidebar {
    display: flex;
    gap: 20px;
}


/* Sidebar Styling */
.sidebar {
    width: 250px; /* Fixed width for sidebar */
    background-color: #f8f9fa; /* Lighter background for sidebar */
    padding: 20px;
    border-right: 1px solid #eee; /* Separator line */
    display: flex; /* Use flexbox for vertical layout */
    flex-direction: column; /* Stack sections vertically */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}
.sidebar h3 {
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}
.sidebar-nav li {
    margin-bottom: 10px;
}
.sidebar-nav a {
    text-decoration: none;
    color: #007bff; /* Blue for links */
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.sidebar-nav a:hover {
    background-color: #e9ecef;
    color: #0056b3;
}
.sidebar-nav li.active a {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}
.sidebar-nav li.active a:hover {
    background-color: #0056b3;
    color: white;
}

/* Specific style for "Manage Categories" link */
.sidebar-bold-link a {
    font-weight: bold;
}


/* Main Content Area */
.content {
    flex-grow: 1; /* Take remaining space */
    padding: 20px; /* Keep internal padding */
    background-color: #fff; /* Ensure white background for content area */
}
.content h2 {
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Message Styling */
.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid transparent;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Todo List Styling */
.todo-list {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between todo items */
}

.todo-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column; /* Changed to column layout for details and actions */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}
.todo-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.todo-item.completed {
    background-color: #e0ffe0; /* Lighter green for completed items */
    opacity: 0.7;
    border-color: #c9e0c9;
}

.todo-details {
    width: 100%; /* Take full width within its flex parent */
    padding-right: 0; /* Removed previous right padding */
    margin-bottom: 15px; /* Added space between details and actions */
}
.todo-details h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2em;
}
.todo-item.completed h3 {
    text-decoration: line-through;
    color: #777;
}

.todo-details p {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
}
.todo-details p strong {
    color: #333;
}

.todo-categories {
    margin-top: 10px;
}
.category-tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.todo-actions {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap to the next line */
    justify-content: flex-start; /* Center buttons horizontally */
    gap: 10px; /* Space between buttons */
    width: 100%; /* Ensure actions div takes full width */
    margin-top: auto; /* Push actions to the bottom if content is shorter */
}

/* Adjust forms within todo-actions to not take full width,
   allowing buttons to be side-by-side naturally with flex-wrap */
.todo-actions form {

}

/* General button styling */
.button {
    display: block; /* Make buttons block level within their forms for proper centering */
    width: 100%; /* Make button fill its parent form's width */
    padding: 10px 15px;
    font-size: 0.9em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.button:hover {
    transform: translateY(-1px); /* Lift effect */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Enhanced shadow on hover */
}

/* Specific colors for dashboard buttons */
.button-edit {
    background-color: #007bff; /* Blue */
    color: white;
}
.button-edit:hover {
    background-color: #0056b3;
}

.button-complete {
    background-color: #28a745; /* Green */
    color: white;
}
.button-complete:hover {
    background-color: #218838;
}

.button-incomplete {
    background-color: #ffc107; /* Yellow/Orange */
    color: #333; /* Darker text for contrast */
}
.button-incomplete:hover {
    background-color: #e0a800;
}

.button-delete {
    background-color: #dc3545; /* Red */
    color: white;
}
.button-delete:hover {
    background-color: #c82333;
}

/* Styles for Category Management Page buttons */
.category-actions {
    display: flex; /* Use flexbox for buttons */
    gap: 8px; /* Space between buttons */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Reusing existing button styles, ensuring they are small */
.category-actions .edit-btn,
.category-actions .delete-btn {
    padding: 6px 12px; /* Smaller padding for these buttons */
    font-size: 0.85em; /* Smaller font size */
    min-width: 70px; /* Adjust as needed */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Smaller shadow for smaller buttons */
}

.category-actions .edit-btn:hover,
.category-actions .delete-btn:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); /* Enhanced smaller shadow on hover */
}


.category-actions .edit-btn {
    background-color: #007bff; /* Blue for edit */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease; /* Added box-shadow to transition */
}
.category-actions .edit-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.category-actions .delete-btn {
    background-color: #dc3545; /* Red for delete */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease; /* Added box-shadow to transition */
}
.category-actions .delete-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Form Container Styling */
.form-container {
    background-color: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    /* margin: 7px auto; */
}

.form-group {
    margin-bottom: 25px; /* Spacing between form fields */
}

.form-group label {
    display: block; /* Label on its own line */
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px; /* Rounded corners for inputs */
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #007bff; /* Highlight border on focus */
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); /* Subtle glow on focus */
    outline: none; /* Remove default outline */
}

/* Adjustments for textarea */
textarea.form-control {
    resize: vertical; /* Allow vertical resizing */
    min-height: 80px;
}

/* Adjustments for select multiple (categories) */
select[multiple].form-control {
    height: auto; /* Allow height to adjust based on options */
    min-height: 120px; /* Minimum height for multiple select */
}

.form-text-hint {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* Style for the submit button on forms */
.form-container .button {
    width: auto; /* Override min-width from general button */
    padding: 12px 25px; /* Slightly larger padding for submit buttons */
    margin-top: 10px; /* Space above button */
    font-size: 1.1em;
    background-color: #4CAF50; /* Green submit button */
    color: white;
    /* The specific box-shadow for add-category-button might override this for that specific button, which is fine. */
}

.form-container .button:hover {
    background-color: #45a049;
}

/* Style for the "Back to Dashboard" link */
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Category List Display Specific Styles */
.category-list-display {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Space between category items */
    margin-bottom: 20px; /* Add some space between the list and the button */
}

.category-item {
    display: flex; /* Use flexbox to align name and actions horizontally */
    justify-content: space-between; /* Push name to left, actions to right */
    align-items: center; /* Vertically center the content */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px; /* Rounded corners */
    padding: 12px 15px; /* Internal padding */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Subtle shadow */
    transition: box-shadow 0.2s ease; /* Smooth hover effect */
}

.category-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Enhanced shadow on hover */
}

.category-name {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
    flex-grow: 1; /* Allow it to take available space */
    margin-right: 20px; /* Mandatory separation from buttons */
    word-break: break-word; /* Prevents overflow for very long names */
}

/* Container for centering the add category button */
.add-category-button-container {
    text-align: center; /* Center the inline-block button */
    margin-top: 20px; /* Add space above the button */
    margin-bottom: 20px; /* Add space below the button */
}

/* Styles for ADD CATEGORY BUTTON itself (retained from previous step, slightly adjusted shadow) */
.add-category-button {
    display: inline-flex; /* Use flexbox to align icon and text */
    align-items: center; /* Vertically center icon and text */
    gap: 8px; /* Space between icon and text */
    background-color: #28a745; /* Green color for prominence */
    color: white;
    padding: 12px 20px; /* Larger padding */
    font-size: 1.1em; /* Larger font size */
    font-weight: bold;
    border-radius: 8px; /* More rounded corners */
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2); /* Specific subtle shadow for depth on this button */
}

.add-category-button:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3); /* Enhanced shadow on hover */
}

.add-category-button .icon-plus {
    font-size: 1.4em; /* Larger size for the plus icon */
    line-height: 1; /* Ensure proper vertical alignment */
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #e0f2f7; /* Light blue background on hover */
}

.stat-card i {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #007bff;
}

.stat-card h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #6c757d;
}

.stat-card p {
    font-size: 2em;
    font-weight: bold;
    margin: 0;
    color: #343a40;
}

.dashboard-stats a {
    text-decoration: none;
}

/* Dashboard Charts */
.dashboard-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.chart-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    flex: 1 1 calc(50% - 20px); /* Two columns, with gap */
    max-width: calc(50% - 20px); /* Ensure two columns */
    box-sizing: border-box; /* Include padding in width */
    /* Removed fixed height */
}

.chart-card h3 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.chart-card .chart-container {
    position: relative;
    height: 300px; /* Fixed height for the chart container */
}

.chart-card canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important; /* Fill the parent container */
}

.form-actions-group {
    display: flex;
    gap: 15px; /* Creates space between the buttons */
    margin-top: 10px; /* Same margin as the original button had */
}

.form-container .button.button-delete {
    background-color: #dc3545; /* Red */
    color: white;
}

.form-container .button.button-delete:hover {
    background-color: #c82333; /* Darker red on hover */
}

#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    border: none;
    outline: none;
    background-color: rgba(0, 123, 255, 0.8);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
}

#scrollTopBtn:hover {
    background-color: #0056b3;
}