/* static/css/forms.css - Optimized Form Styles */

/* ===== BASE FORM STYLES ===== */
.needs-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    font-family: inherit;
}

.needs-form.disabled {
    pointer-events: none;
    opacity: 0.6;
    user-select: none;
}

.needs-form h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.2em;
    font-weight: bold;
}

/* Form controls */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.4;
}

/* Labels and groups */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== MESSAGE-BASED NEEDS FORM ===== */

/* Common button styles */
.location-btn,
.day-btn,
.action-btn,
.notes-btn,
.confirm-btn,
.confirm-time-btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.location-btn:disabled,
.day-btn:disabled,
.action-btn:disabled,
.notes-btn:disabled,
.confirm-btn:disabled,
.confirm-time-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Selection containers */
.selection-buttons {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Location buttons */
.location-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 15px 20px;
    text-align: left;
    line-height: 1.4;
}

.location-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.default-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
    font-weight: bold;
}

/* Day selection */
.day-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.day-btn {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #ffcc02;
    border-radius: 10px;
    padding: 12px 16px;
    text-transform: capitalize;
}

.day-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fff3e0, #ffcc02);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 2, 0.3);
}

/* Time selection */
.time-selection {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.time-inputs-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.time-input-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.time-input-item label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    white-space: nowrap;
}

.time-select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 120px;
}

.time-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.confirm-time-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 24px;
    width: 100%;
    margin-top: 10px;
}

.confirm-time-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Action buttons (Yes/No) */
.action-buttons {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.action-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.action-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* Notes section */
.notes-input-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.notes-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
    background: white;
    line-height: 1.5;
    box-sizing: border-box;
}

.notes-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.notes-textarea::placeholder {
    color: #6c757d;
    font-style: italic;
}

.notes-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.notes-btn {
    flex: 1;
    padding: 12px 20px;
}

.notes-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.notes-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.notes-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.notes-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* Confirmation section */
.needs-confirmation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    margin: 15px 0;
    border: 2px solid #dee2e6;
}

.needs-confirmation h3 {
    margin: 0 0 20px 0;
    color: #28a745;
    font-size: 18px;
    text-align: center;
}

.confirmation-details {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
    gap: 10px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: #495057;
    min-width: 120px;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
}

.confirm-btn {
    flex: 1;
    padding: 15px 20px;
    border-radius: 10px;
}

.confirm-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.confirm-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.confirm-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.confirm-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0 0;
}

.view-needs-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
}

.view-needs-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.needs-confirmation,
.time-selection,
.selection-buttons,
.notes-input-container {
    animation: slideInUp 0.4s ease;
}

/* ===== LEGACY FORM ELEMENTS ===== */
.submit-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    width: 100%;
    margin-top: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-text {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.form-error-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    color: #721c24;
}

.form-error-summary ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

/* Checkbox and hashtag styles (if needed) */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group .form-label {
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
}

.hashtag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 4px;
}

.hashtag-item {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 12px;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
}

.hashtag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.hashtag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {

    .form-row,
    .confirmation-actions,
    .notes-actions {
        flex-direction: column;
    }

    .time-inputs-row {
        flex-direction: column;
        gap: 15px;
    }

    .time-input-item {
        min-width: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .time-input-item label {
        text-align: left;
    }

    .day-selection {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .detail-item strong {
        min-width: auto;
    }

    .needs-form,
    .needs-confirmation {
        padding: 16px;
    }

    .needs-form h3 {
        font-size: 1.1em;
    }

    .location-btn {
        padding: 12px 15px;
        font-size: 13px;
    }

    .day-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .notes-textarea {
        min-height: 80px;
    }
}