/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    color: #2d3748;
    padding: 1.25rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Main content area */
main {
    padding: 2.5rem 0;
    min-height: calc(100vh - 100px);
}

.content-area {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Login container */
.login-container {
    max-width: 440px;
    margin: 3rem auto;
}

.login-container h2 {
    margin-bottom: 2rem;
    color: #1a202c;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
}

/* Form styles */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f7fafc;
    min-height: 48px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: white;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6b4193 100%);
}

.btn-secondary {
    background-color: #718096;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a5568;
}

/* Error message */
.error-message {
    color: #c53030;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    text-align: center;
    min-height: 1.5rem;
    background-color: #fed7d7;
    border-radius: 8px;
    font-weight: 500;
}

/* Task list styles */
.content-area h2 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-size: 1.875rem;
    font-weight: 700;
}

/* View controls */
.view-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.view-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    background-color: #edf2f7;
    color: #4a5568;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.view-btn:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.view-btn.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6b4193 100%);
}

.loading, .no-tasks {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
    font-size: 1.1rem;
}

.project-group {
    margin-bottom: 2rem;
}

.project-title {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 3px solid transparent;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%) left bottom / 100% 3px no-repeat;
}

.project-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
    border-color: #cbd5e0;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.task-id {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.task-title {
    font-size: 1.25rem;
    color: #1a202c;
    margin: 0;
    word-break: break-word;
    font-weight: 600;
    line-height: 1.4;
}

.task-status {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-met {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.status-not-met {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.status-completed {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.completed-task {
    border-left: 5px solid #48bb78;
    background: linear-gradient(to right, #f0fdf4 0%, white 100%);
}

.task-meta-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
}

.task-requirements {
    margin-bottom: 1rem;
}

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

.requirements-header strong {
    color: #495057;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #3498db;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s;
}

.toggle-btn:hover {
    color: #2980b9;
}

.requirements-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.requirements-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.625rem;
    background: linear-gradient(to right, #f7fafc 0%, white 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.requirements-list li:hover {
    background: white;
    border-left-color: #764ba2;
    transform: translateX(4px);
}

.requirements-list.hidden {
    display: none;
}

.task-notes {
    background-color: #e8f4f8;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #495057;
}

.task-notes strong {
    color: #2c3e50;
}

.task-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.75rem;
}

/* Page actions layout */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-actions .view-controls {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.page-actions .action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.page-actions .btn-primary {
    width: auto;
    white-space: nowrap;
}

/* Ralph button */
.btn-ralph {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white;
    text-decoration: none;
    display: inline-flex;
}

.btn-ralph:hover:not(.disabled) {
    background: linear-gradient(135deg, #7e22ce 0%, #6b21a8 100%);
}

.btn-ralph.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #a0aec0;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    margin: 0;
}

/* Message styles */
.message {
    padding: 1.125rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-message {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 2px solid #48bb78;
}

.error-message {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border: 2px solid #f56565;
}

.message.hidden {
    display: none;
}

/* Message container for status updates */
.message-container {
    padding: 1.125rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-container.message-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 2px solid #48bb78;
}

.message-container.message-error {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border: 2px solid #f56565;
}

.message-container.message-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #2c5282;
    border: 2px solid #4299e1;
}

/* Task actions */
.task-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.75rem;
}

.btn-complete {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    min-height: 48px;
}

.btn-complete:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
    transform: translateY(-2px);
}

.btn-complete:active {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    transform: translateY(0);
}

/* Task form styles */
.task-form {
    max-width: 800px;
}

.task-form .form-group {
    margin-bottom: 1.75rem;
}

.task-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
}

.task-form input[type="text"],
.task-form select,
.task-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f7fafc;
    min-height: 48px;
}

.task-form input:focus,
.task-form select:focus,
.task-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: white;
}

.task-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* Requirements input list */
.requirements-input-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.requirement-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.requirement-input {
    flex: 1;
}

.btn-remove {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    padding: 0.875rem 1.25rem;
    white-space: nowrap;
    min-height: 48px;
}

.btn-remove:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.form-actions .btn {
    min-width: 120px;
}

.form-actions .btn-primary {
    flex: 1;
    max-width: 300px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    header {
        padding: 1rem 0;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .content-area {
        padding: 1.75rem;
        border-radius: 12px;
    }

    .content-area h2 {
        font-size: 1.5rem;
    }

    .view-controls {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .task-title {
        font-size: 1.125rem;
    }

    .task-card {
        padding: 1.25rem;
    }

    .task-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .page-actions .view-controls {
        width: 100%;
        margin-bottom: 0;
    }

    .page-actions .action-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.875rem;
    }

    .page-actions .btn-primary,
    .page-actions .btn-ralph,
    .page-actions .btn-secondary {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.875rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-actions .btn-primary {
        max-width: none;
    }

    .requirement-item {
        flex-direction: column;
        gap: 0.625rem;
    }

    .btn-remove {
        width: 100%;
    }

    /* Increase touch targets on mobile */
    .toggle-btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

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

    .task-actions .btn-complete {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    header h1 {
        font-size: 1.375rem;
    }

    .container {
        padding: 0 0.875rem;
    }

    .content-area {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .content-area h2 {
        font-size: 1.375rem;
    }

    .project-title {
        font-size: 1.125rem;
    }

    .task-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }

    .task-title {
        font-size: 1.0625rem;
    }

    .task-status {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }

    .task-card {
        padding: 1rem;
    }

    .view-btn {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem;
    }

    .btn {
        font-size: 0.9375rem;
        padding: 0.75rem 1.25rem;
    }
}
