/* General Body and Container Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    display: grid; /* Use grid for main content layout */
    gap: 30px; /* Space between form and list cards */
    grid-template-columns: 1fr; /* Default to single column on small screens */
}

/* Adjust grid for larger screens */
@media (min-width: 992px) {
    main {
        grid-template-columns: 1fr 2fr; /* Two columns: form (1 part) and list (2 parts) */
    }
}

/* Header Styles (Consistent with other NoteNest pages) */
header {
    background-color: #2c3e50; /* Dark blue/grey */
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo-title {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
}

.logo-title img {
    height: 40px;
    margin-right: 10px;
}

.logo-title h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.logo-title .subtitle {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    margin: -5px 0 0 0;
    color: #a7d9f7; /* Lighter blue for subtitle */
}

.header-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Allow wrapping */
}

.header-btn {
    background-color: #3498db; /* Blue */
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn:hover {
    background-color: #2980b9; /* Darker blue on hover */
}

/* Goals Banner Section */
.goals-banner-section {
    grid-column: 1 / -1; /* Span full width in grid */
    display: flex;
    background: linear-gradient(135deg, #ede7f6, #d1c4e9); /* Light purple gradient */
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping */
}

.goals-banner-left {
    flex: 1;
    min-width: 250px; /* Minimum width for the image container */
}

.goals-banner-left img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.goals-banner-text {
    flex: 2;
    padding: 20px 30px;
    color: #311b92; /* Dark purple text */
    min-width: 300px; /* Minimum width for the text container */
}

.goals-banner-text h3 {
    font-size: 24px;
    color: #4527a0; /* Darker purple heading */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.goals-banner-text ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.goals-banner-text li {
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.goals-banner-text li i {
    color: #7e57c2; /* Medium purple icons */
    font-size: 18px;
}

/* Card Styles (for form and list sections) */
.form-card,
.list-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-card h2,
.list-card h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
form .form-group {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

form input[type="text"],
form input[type="number"],
form input[type="date"],
form select,
form textarea {
    width: calc(100% - 20px); /* Adjust for padding */
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input[type="text"]:focus,
form input[type="number"]:focus,
form input[type="date"]:focus,
form select:focus,
form textarea:focus {
    border-color: #7e57c2; /* Purple focus color */
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.2);
    outline: none;
}

form textarea {
    resize: vertical;
    min-height: 80px;
}

.inline-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping */
}

.inline-group .input-with-label {
    flex: 1;
    min-width: 150px; /* Minimum width for each input in inline group */
}

.add-button {
    background-color: #4CAF50; /* Green for add button */
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.add-button:hover {
    background-color: #45a049; /* Darker green on hover */
}

/* List Section Styles */
.view-toggle-buttons {
    display: flex;
    justify-content: flex-end; /* Align to right */
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    background-color: #ecf0f1; /* Light grey */
    color: #2c3e50;
    padding: 10px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    background-color: #dbe4e6;
}

.toggle-btn.active-view {
    background-color: #7e57c2; /* Purple for active view */
    color: #fff;
    border-color: #7e57c2;
}

.toggle-btn.active-view:hover {
    background-color: #673ab7;
}

.info-message {
    text-align: center;
    padding: 30px;
    background-color: #f3e5f5; /* Very light purple for info */
    border: 1px dashed #e1bee7;
    border-radius: 8px;
    color: #4a148c; /* Darker purple for text */
    font-size: 16px;
    margin-top: 20px;
}

.card-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.goal-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push actions to bottom */
    border-left: 5px solid #7e57c2; /* Purple left border */
}

.goal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.goal-card h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    word-break: break-word; /* Prevent long titles from overflowing */
}

.goal-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.card-progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.card-progress {
    height: 100%;
    background-color: #4CAF50; /* Green for progress */
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.card-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: right;
    margin-top: 5px;
}

.goal-status {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    font-size: 12px;
    margin-top: 8px;
}

.status-in-progress { background-color: #e0f2f7; color: #00838f; } /* Light cyan */
.status-completed { background-color: #e8f5e9; color: #2e7d32; } /* Light green */
.status-on-hold { background-color: #fffde7; color: #fbc02d; } /* Light yellow */
.status-cancelled { background-color: #ffebee; color: #d32f2f; } /* Light red */
.status-other { background-color: #f5f5f5; color: #616161; } /* Light grey */


.card-actions {
    display: flex;
    justify-content: flex-end; /* Align delete button to the right */
    margin-top: 10px;
}

.card-actions button {
    background-color: #dc3545; /* Red for delete */
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-actions button:hover {
    background-color: #c82333;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto; /* Enable horizontal scrolling for tables on small screens */
    margin-top: 20px;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.notes-table th,
.notes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle; /* Align content vertically */
}

.notes-table th {
    background-color: #7e57c2; /* Purple header for table */
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap; /* Prevent headers from wrapping */
}

.notes-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.notes-table tr:hover {
    background-color: #ede7f6; /* Lighter purple on hover */
}

.table-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.table-action-btn.delete-btn {
    color: #dc3545; /* Red */
}

.table-action-btn.delete-btn:hover {
    background-color: #ffe0e0;
}

/* Table Footer for Totals - Not applicable for goals directly, but keep structure */
/* .notes-table tfoot {
    font-weight: 600;
    background-color: #d1c4e9;
    color: #311b92;
}

.notes-table tfoot td {
    padding: 15px;
    border-top: 2px solid #7e57c2;
    font-size: 16px;
}

.table-total-label {
    text-align: right;
    padding-right: 15px;
}

.table-total-amount {
    text-align: left;
    color: #4a148c;
} */

/* Utility Class */
.hidden-view {
    display: none;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.export-btn {
    background-color: #6c757d; /* Grey */
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background-color: #5a6268;
}

/* Footer Styles */
footer {
    margin-top: 30px;
    padding: 15px;
    background-color: #2c3e50;
    color: #f4f7f6;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .header-buttons {
        justify-content: center;
        width: 100%;
    }
    .header-btn {
        flex-grow: 1; /* Allow buttons to expand */
        justify-content: center;
    }
    .goals-main-content {
        padding: 15px;
    }

    .goals-banner-section {
        flex-direction: column;
    }
    .goals-banner-text {
        padding: 15px;
    }
    .form-card, .list-card {
        padding: 20px;
    }
    .form-card h2, .list-card h2 {
        font-size: 20px;
    }
    form input[type="text"],
    form input[type="number"],
    form input[type="date"],
    form select,
    form textarea {
        width: calc(100% - 24px); /* Adjust for padding and border */
    }
    .inline-group {
        flex-direction: column;
        gap: 15px;
    }
    .view-toggle-buttons {
        justify-content: center;
        width: 100%;
    }
    .toggle-btn {
        flex-grow: 1;
        justify-content: center;
    }
    .export-buttons {
        flex-direction: column;
        align-items: center;
    }
    .export-btn {
        width: 100%;
        justify-content: center;
    }
    .notes-table th, .notes-table td {
        padding: 10px;
        font-size: 13px;
    }
    /* .table-total-label, .table-total-amount {
        font-size: 14px;
    } */
    .goal-card {
        padding: 15px;
    }
    .goal-card h4 {
        font-size: 16px;
    }
    .goal-card p, .card-amount {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .logo-title h1 {
        font-size: 20px;
    }
    .logo-title .subtitle {
        font-size: 16px;
    }
    .header-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
    .goals-banner-text h3 {
        font-size: 20px;
    }
    .goals-banner-text li {
        font-size: 14px;
    }
}
