/**
 * Shared Accountability Partner App - Custom Styles
 * Elegant Color Scheme: Slate/Charcoal base with Violet/Cyan accents
 */

/* Elegant Color Variables */
:root {
    --color-primary: #6366f1; /* Indigo/Violet */
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-accent: #06b6d4; /* Cyan */
    --color-accent-dark: #0891b2;
    --color-bg: #f8fafc; /* Slate-50 */
    --color-surface: #ffffff;
    --color-text: #1e293b; /* Slate-800 */
    --color-text-light: #64748b; /* Slate-500 */
    --color-border: #e2e8f0; /* Slate-200 */
    --color-success: #10b981; /* Emerald */
    --color-success-dark: #059669;
}

/* Modal Overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6); /* Slate-900 with opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

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

/* Modal Content */
.modal-content {
    background: var(--color-surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--color-border);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scrollbar Styling für Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--color-bg);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-text);
}

/* Button Active States */
button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease-out;
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Task Card Hover Effect */
.bg-white.border.border-gray-200.rounded-lg {
    transition: box-shadow 0.2s ease-out;
}

.bg-white.border.border-gray-200.rounded-lg:hover {
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
}

/* Feed Card Styling */
.feed-card {
    transition: background-color 0.2s ease-out;
}

.feed-card:hover {
    background-color: rgb(241, 245, 249); /* slate-100 für leicht dunkleren Hover */
}

/* Badge Animation */
#feedBadge {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Loading State (für zukünftige Verwendung) */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Subtask Row Animation */
.subtask-row {
    animation: slideIn 0.2s ease-out;
}

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

/* Reaction Button Hover */
.reaction-btn:hover {
    background-color: var(--color-bg);
    transform: scale(1.05);
}

.reaction-btn:active {
    transform: scale(0.95);
}

/* Proof Mode Button Active State */
#proofTextBtn.bg-indigo-50,
#proofAudioBtn.bg-indigo-50,
#proofVideoBtn.bg-indigo-50 {
    background-color: rgb(238, 242, 255);
    border-color: var(--color-primary-light);
}

/* Tab Active State */
#tabTasks.border-indigo-600,
#tabFeed.border-indigo-600 {
    border-bottom-width: 2px;
    border-bottom-color: var(--color-primary);
    color: var(--color-text);
    font-weight: 500;
}

/* Identity Toggle Button */
#identityToggle {
    transition: all 0.2s ease-out;
}

#identityToggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#identityToggle:active {
    transform: scale(0.95);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
    }
}

/* Custom Scrollbar für die gesamte App */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text);
}

/* Elegant Input Field with Integrated Buttons */
.todo-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem;
    transition: all 0.2s ease-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    min-height: 3rem;
}

.todo-input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.todo-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--color-text);
    font-size: 0.9375rem;
}

.todo-input-wrapper input::placeholder {
    color: var(--color-text-light);
}

.todo-input-wrapper .input-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
    padding: 0;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.todo-input-wrapper .input-button:hover {
    background: #f1f5f9;
    color: #6366f1;
    transform: scale(1.05);
}

.todo-input-wrapper .input-button:active {
    transform: scale(0.95);
}

.todo-input-wrapper .input-button svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.todo-input-wrapper .input-button-primary {
    color: #6366f1;
}

.todo-input-wrapper .input-button-primary:hover {
    background: #6366f1;
    color: white;
}

.todo-input-wrapper .input-button-ai {
    color: #06b6d4;
}

.todo-input-wrapper .input-button-ai:hover {
    background: #06b6d4;
    color: white;
}

/* Modal Textarea Wrapper (ChatGPT-style) */
.modal-textarea-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: all 0.2s ease-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.modal-textarea-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-textarea {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem 0.75rem;
    padding-right: 3rem;
    background: transparent;
    color: var(--color-text);
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 6rem;
    font-family: inherit;
}

.modal-textarea::placeholder {
    color: var(--color-text-light);
}

.modal-textarea-buttons {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.modal-input-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
    padding: 0;
    flex-shrink: 0;
}

.modal-input-button:hover {
    background: #f1f5f9;
    color: #6366f1;
    transform: scale(1.05);
}

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

.modal-input-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-input-button svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.modal-input-button-audio {
    color: #06b6d4;
}

.modal-input-button-audio:hover {
    background: #06b6d4;
    color: white;
}

.modal-input-button-submit {
    color: #6366f1;
}

.modal-input-button-submit:hover {
    background: #6366f1;
    color: white;
}

.modal-input-button-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-input-button-submit:disabled:hover {
    background: transparent;
    color: #64748b;
}

/* Todo List Styling */
.todo-item {
    position: relative;
    user-select: none;
}

.todo-item .task-checkbox {
    accent-color: #f97316; /* Orange */
    cursor: pointer;
    flex-shrink: 0;
}

.todo-item .task-checkbox:checked {
    background-color: #f97316;
    border-color: #f97316;
}

.reaction-button {
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.reaction-button:hover {
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

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

/* Long-press visual feedback */
.todo-item.long-pressing {
    background-color: #f3f4f6;
}

/* Todo list container */
#todoList {
    min-height: 100px;
}

/* Orange underline for "To do:" */
.decoration-orange-500 {
    text-decoration-color: #f97316;
}

/* Reaction Popover Styling (WhatsApp-style) */
.reaction-popover {
    position: fixed;
    z-index: 1000;
    background: white;
    border-radius: 2rem;
    padding: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: popoverFadeIn 0.2s ease-out;
    pointer-events: auto;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reaction-popover-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: #f97316;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-out;
    flex-shrink: 0;
}

.reaction-popover-button:hover {
    background: #ea580c;
    transform: scale(1.1);
}

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

.reaction-popover-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Zusätzliche Button-Farben für Edit/Delete/Move */
.reaction-popover-button.bg-indigo-500 {
    background: #6366f1;
}

.reaction-popover-button.bg-indigo-500:hover {
    background: #4f46e5;
}

.reaction-popover-button.bg-red-500 {
    background: #ef4444;
}

.reaction-popover-button.bg-red-500:hover {
    background: #dc2626;
}

.reaction-popover-button.bg-blue-500 {
    background: #3b82f6;
}

.reaction-popover-button.bg-blue-500:hover {
    background: #2563eb;
}

.reaction-popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
    pointer-events: auto;
}

