/* Alfred - Gestionnaire de listes - Style EXACT de Joshua */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1f2937;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0 20px 0;
    flex-shrink: 0;
}

.header-left {
    text-align: left;
}

.header-right {
    display: flex;
    align-items: center;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.mute-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.mute-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.mute-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.mute-btn svg {
    width: 18px;
    height: 18px;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

/* Auth Button */
.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-btn svg {
    width: 18px;
    height: 18px;
}

.logout-btn {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
    color: #dc2626;
    margin-left: 10px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #fecaca 0%, #f87171 100%);
    border-color: #dc2626;
    color: #fff;
}

/* Chat Area - Adaptée pour Alfred */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    scroll-behavior: smooth;
}

/* Welcome Screen centré comme dans Joshua */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 40px 0;
}

.welcome-screen h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.welcome-screen p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 40px;
    max-width: 500px;
}

.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

/* Boutons avec le style exact de Joshua */
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-action-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.quick-action-btn.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Listes récentes */
.recent-lists {
    width: 100%;
    max-width: 600px;
}

.recent-lists h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    text-align: center;
}

.list-item {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    line-height: 1.5;
}

.list-item:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}

.list-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Input Area - Style exact de Joshua */
.input-container {
    flex-shrink: 0;
    padding: 20px 0 40px 0;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    padding: 8px;
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-upload-btn, .mic-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.file-upload-btn:hover, .mic-btn:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.file-upload-btn:active, .mic-btn:active {
    transform: scale(0.95);
}

.mic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#action-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    padding: 8px 12px;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
}

#action-input::placeholder {
    color: #9ca3af;
}

.send-btn {
    background-color: #2563eb;
    border: none;
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    opacity: 0.6;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.send-btn:enabled {
    opacity: 1;
}

.send-btn:hover:enabled {
    background-color: #1d4ed8;
    transform: scale(1.05);
}

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

.send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.input-footer {
    text-align: center;
    margin-top: 12px;
}

.help-text {
    font-size: 0.8rem;
    color: #9ca3af;
}

kbd {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* Loading Indicator - Style exact de Joshua */
.loading-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #6b7280;
    z-index: 1000;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modals avec style Joshua */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.btn-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-input, .form-textarea {
    width: 100%;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.form-file {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.form-file:hover {
    border-color: #2563eb;
}

.form-file input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-cancel {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #9ca3af;
}

/* Views pour les listes et items */
.lists-view, .items-view {
    padding: 20px 0;
}

.lists-view h2, .items-view h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 20px;
}

.lists-grid, .items-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.item-card {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    transition: all 0.2s ease;
}

.item-card:hover {
    background-color: #e5e7eb;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-checkbox.checked {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: #374151;
    background-color: #e5e7eb;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 20px 0 16px 0;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .quick-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 24px;
    }
}