/* GTD App Custom CSS */

/* System Fonts */

/* Animation Keyframes */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
figure,
figcaption,
blockquote,
dl,
dd {
    margin: 0;
}

ul,
ol {
    list-style: none;
}

a {
    text-decoration-skip-ink: auto;
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

input,
button,
textarea,
select {
    font: inherit;
}

button {
    border: 1px;
}

/* Base styles */
:root {
    --font-primary:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --font-mono:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    --primary-color: #24a75b;
    --hover-color: #1e8b4f; /* Slightly darker for hover states */
    --secondary-color: #209150;
    --accent-color: #e74c3c;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    --surface-elevated: #fdfdfd;
    --surface-sunken: #f9f9f9;

    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    /* Remove old gray variables - use gray-50 through gray-900 instead */

    /* Text colors */
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #777777;

    /* Background colors */
    --bg-body: #f5f5f7;
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-color: #e0e0e0;

    /* Alert colors */
    --alert-bg: #f8f9fa;
    --success-bg: rgba(46, 204, 113, 0.1);
    --error-bg: rgba(231, 76, 60, 0.1);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-primary);
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

header {
    color: var(--text-primary);
}

footer {
    background-color: var(--gray-700);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-credits {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.heart {
    color: var(--accent-color);
    display: inline-block;
    animation: pulse 1.5s infinite;
}

/* Navigation */
nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 2rem;
    flex-wrap: wrap;
}

nav .brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    animation: slideRight 0.5s ease-out;
    margin-right: 2rem;
}

nav .brand a {
    color: white;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

nav .brand a.logo-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease;
}

nav .brand a.logo-link:hover::after {
    width: 100%;
}

nav .nav-items {
    display: flex;
    gap: 1.25rem;
}

nav .nav-items a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9;
    transition:
        opacity 0.2s,
        transform 0.2s,
        background-color 0.2s;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    position: relative;
}

nav .nav-items a:hover {
    opacity: 1;
    transform: translateY(-1px);
    background-color: rgba(255, 255, 255, 0.1);
}

nav .nav-items a.active {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
    position: relative;
}

nav .nav-items a.active::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--gray-100);
    border-radius: 0.25rem;
}

.form-group {
    margin-bottom: 0.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    background-color: var(--surface-sunken);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.error {
    color: var(--accent-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.btn,
.btn-primary {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition:
        transform 0.1s,
        opacity 0.2s;
}

.btn {
    background-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    border-radius: 0.25rem;
    padding: 0.625rem 1.25rem;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
    background-color: #27ae60;
}

.btn-success:active {
    transform: translateY(1px);
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.25rem;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    background-color: #c0392b;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
    transform: translateY(1px);
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: currentColor;
    opacity: 0.5;
}

.alert-content {
    position: relative;
    z-index: 1;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert.success .alert-content::before {
    content: "✓";
    font-weight: bold;
    color: #28a745;
}

.alert.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    border-left: 4px solid #dc3545;
}

.alert.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    border-left: 4px solid #28a745;
    animation:
        slideIn 0.3s ease-out,
        fadeOut 5s forwards;
    animation-delay: 0s, 3s;
    margin-bottom: 1rem;
}

.alert.success.hidden {
    display: none;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Section styling */
section {
    margin-bottom: 2.5rem;
}

section h1 {
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 2.25rem;
    letter-spacing: -0.5px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

/* Title with back button styling */
.title-with-back {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.title-with-back h1 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-right: 0.75rem;
}

.back-chevron {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: bold;
    line-height: 1;
    transition: transform 0.2s ease;
}

.back-link:hover .back-chevron {
    transform: translateX(-3px);
    color: var(--text-primary);
}

section h2 {
    margin: 1.5rem 0 1rem;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.3px;
}

section p {
    color: var(--gray-700);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--gray-100);
    border-radius: 0.25rem;
    padding: 1.75rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    border-bottom: 3px solid var(--secondary-color);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.quick-capture {
    border-radius: 0.25rem;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.action-card {
    background-color: var(--gray-100);
    border-radius: 0.25rem;
    padding: 1.5rem;
}

.filter-controls,
.task-filters {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Task Lists */
.task-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    /*gap: 0.75rem;*/
    border-radius: 0.5rem;
}

.task-list > * {
    opacity: 1;
    /* margin-bottom: 0.75rem; */
}

.task-list:last-child {
    margin-bottom: 0.75rem;
}

/* Task detail styles */
.task-detail-card {
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 1rem;
    border-left: 4px solid var(--secondary-color);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.task-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.task-status {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
}

.task-status.inbox {
    background-color: #e9ecef;
    color: #495057;
}

.task-status.next {
    background-color: #cce5ff;
    color: #004085;
}

.task-status.waiting {
    background-color: #fff3cd;
    color: #856404;
}

.task-status.someday {
    background-color: #d1ecf1;
    color: #0c5460;
}

.task-status.complete {
    background-color: #d4edda;
    color: #155724;
}

.task-notes {
    margin-bottom: 2rem;
    background-color: var(--bg-input);
    padding: 1rem;
    border-radius: 0.25rem;
    border-left: 3px solid var(--gray-300);
}

.task-notes h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.task-notes p {
    margin-bottom: 0;
    white-space: pre-wrap;
}

.task-metadata {
    margin-bottom: 2rem;
}

.metadata-item {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    align-items: center;
}

.metadata-item .label {
    font-weight: 600;
    color: var(--gray-700);
    width: 100px;
    flex-shrink: 0;
}

.metadata-item .value {
    color: var(--primary-color);
}

.metadata-item .value.overdue {
    color: var(--accent-color);
    font-weight: 600;
}

.task-item {
    background-color: var(--gray-100);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border-left: 3px solid var(--gray-300);
    border-bottom: 1px solid var(--border-color);
}

.task-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left-color: var(--gray-300);
    background-color: var(--gray-50);
    transition: all 0.2s ease;
}

/* Special hover styles for different task lists */
.inbox-list .task-item:hover {
    border-left-color: var(--primary-color);
}

.next-list .task-item:hover {
    border-left-color: var(--success-color);
}

.waiting-list .task-item:hover {
    border-left-color: var(--warning-color);
}

.someday-list .task-item:hover {
    border-left-color: var(--accent-color);
}

.task-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.task-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.task-checkbox {
    flex-shrink: 0;
    margin-top: 0.3rem;
}

.checkbox-button {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    position: relative;
}

.checkbox-button:hover {
    background-color: var(--gray-300);
    border-color: var(--secondary-color);
    transform: scale(1.08);
    animation: pulse 1s infinite;
}

.checkbox-button:active {
    transform: scale(0.95);
}

.checkbox-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.task-content {
    flex-grow: 1;
}

.task-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-top: 0.5rem;
    align-items: center;
}

.task-due.overdue {
    color: var(--accent-color);
    font-weight: 600;
    position: relative;
}

.task-due.overdue:before {
    content: "!";
    position: absolute;
    right: -6px;
    top: -6px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--bg-input);
    font-size: 10px;
    font-weight: bold;
    box-shadow: 1px 1px 2px #000000eb;
}

.task-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-self: end;
}

/* Task detail action buttons */
.task-detail-card .task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition:
        color 0.2s,
        background-color 0.2s,
        box-shadow 0.2s;
    position: relative;
    border-radius: 4px;
}

.btn-link:hover {
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.btn-link.btn-danger:hover {
    color: white;
    background-color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-link:focus {
    outline: none;
    text-decoration: underline;
}

.btn-link.btn-danger:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    text-decoration: none;
}

.btn-link.btn-danger:active {
    transform: translateY(1px);
}

/* Project Cards */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-list > * {
    opacity: 1;
}

/* Project list items */
.project-list > * {
    margin-bottom: 1rem;
}

.project-card {
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.project-header h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition:
        color 0.2s,
        transform 0.2s;
    display: inline-block;
}

.project-header h3 a:hover {
    color: var(--secondary-color);
}

.project-description {
    margin-bottom: 1rem;
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: 1.5;
}

.project-meta {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

/* Form Utilities */
.form-group.inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
}

.form-group.inline input {
    flex: 1;
    min-width: 200px;
}

.form-group.inline button {
    white-space: nowrap;
}

/* Custom Select Styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='6' fill='%232c3e50'><path d='M0 0l6 6 6-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
    padding-right: 2rem;
    cursor: pointer;
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Action bar */
.action-bar {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-left: 4px solid var(--secondary-color);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    background-color: var(--gray-100);
    border-radius: 0.5rem;
    color: var(--gray-700);
    font-size: 1.1rem;
    border: 1px dashed var(--border-color);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Process wizard responsive styles */
@media (max-width: 768px) {
    .process-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .process-actions button {
        width: 100%;
    }
}

/* Task edit form specific */
#task_edit textarea {
    min-height: 100px;
    resize: vertical;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 0.5rem;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 0rem;
    }

    nav .nav-items {
        flex-wrap: wrap;
        justify-content: center;
    }

    .form-group.inline {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .form-group.inline button {
        width: 100%;
        margin-top: 0.5rem;
    }

    .task-item {
        flex-direction: column;
    }

    .task-actions {
        margin-top: 1rem;
        align-self: flex-end;
    }

    section h1 {
        font-size: 1.75rem;
    }

    section h2 {
        font-size: 1.25rem;
    }
}

hr.profile-divider {
    margin: 1rem 0;
}

.password-section {
    margin-top: 2rem;
}
