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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
    height: 100vh;
}

.asana-menu {
    width: 100%;
    max-width: 500px;
    padding: 16px;
    background-color: #1a1a1a;
    height: 100%;
}

/* Header */
.header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

/* Settings Menu */
.settings-menu {
    position: relative;
}

.settings-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 150px;
    display: none;
}

.settings-dropdown.show {
    display: block;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #4b5563;
}

.logout-btn {
    color: #ef4444;
}

.logout-btn:hover {
    background-color: #7f1d1d;
}

/* Progressive loading states */
.content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.content-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.content-loading p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

.error-state {
    text-align: center;
    padding: 20px;
}

.error-state p {
    color: #ef4444;
    margin-bottom: 12px;
}

/* Disabled button state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.asana-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 500;
}

.asana-dots {
    display: flex;
    gap: 2px;
    align-items: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.red { background-color: #f06a6a; }
.dot.orange { background-color: #f4b942; }
.dot.yellow { background-color: #ffd93d; }

.dropdown-arrow {
    margin-left: 4px;
    font-size: 10px;
    color: #888;
}

.workspace-info {
    text-align: center;
    color: #9aa5b1;
    font-size: 12px;
    font-weight: 400;
}

/* Main Actions */
.main-actions {
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #f06a6a, #f4942e);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e55a5a, #e39251);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(240, 106, 106, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3a8eef, #0056bc);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-link {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.btn-link:hover {
    color: #fff;
    border-color: #555;
    background: rgba(255, 255, 255, 0.05);
}

/* Tasks Container */
.tasks-container {
    flex: 1;
}

.tasks-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.project-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f06a6a;
}

.project-name {
    color: #fff;
}

.tasks-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    min-height: 180px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.loading {
    text-align: center;
    color: #888;
    font-size: 13px;
}

.tasks-footer {
    text-align: center;
}

.hide-completed {
    color: #888;
    font-size: 13px;
    text-decoration: none;
}

.hide-completed:hover {
    color: #fff;
}

/* Task Items */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-checkbox.completed {
    background-color: #4caf50;
    border-color: #4caf50;
    color: white;
}

.task-checkbox.completed::after {
    content: '✓';
    font-size: 10px;
    font-weight: bold;
}

.task-content {
    flex: 1;
}

.task-content-link {
    color: inherit;
    text-decoration: none;
    flex: 1;
    display: block;
}

.task-content-link:hover {
    color: inherit;
}

.task-content-link:hover .task-name {
    color: #4CAF50;
}

.task-name {
    font-size: 14px;
    margin-bottom: 4px;
    color: #fff;
}

.task-name.completed {
    text-decoration: line-through;
    color: #888;
}

.task-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-date {
    background: rgba(240, 106, 106, 0.2);
    color: #f06a6a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Modal Styles */
.modal, .form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content, .form-container {
    background-color: #2a2a2a;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-header h3, .form-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
}

.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header p {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #ccc;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
}

.form-group-half {
    flex: 1;
}

.form-input, .form-textarea, .form-select, .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus, .form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-input::placeholder, .form-textarea::placeholder, .form-control::placeholder {
    color: #666;
}

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

/* Modal Actions */
.modal-actions, .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel {
    background: transparent;
    color: #888;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    color: #fff;
    border-color: #666;
}

.btn-create, .btn-submit {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-create:hover, .btn-submit:hover {
    background: #357abd;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading State Styles */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    text-align: center;
    padding: 40px 20px;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid #f06a6a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-state p {
    color: #888;
    font-size: 14px;
}

/* Auth Prompt Styles */
.auth-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.auth-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.auth-content .asana-dots {
    justify-content: center;
    margin-bottom: 20px;
}

.auth-content h3 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.auth-content p {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-content .btn {
    margin-bottom: 16px;
}

.auth-note {
    font-size: 12px;
    color: #666;
    margin-top: 16px;
}

/* Button Group with Dropdown */
.btn-group {
    position: relative;
    display: flex;
    flex: 1;
}

.btn-group .btn-main {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-group .btn-dropdown {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 10px 12px;
    flex: none;
    width: auto;
    min-width: 40px;
    position: relative;
}

.dropdown-arrow {
    font-size: 10px;
    opacity: 0.8;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    margin-top: 4px;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #404040;
}

.dropdown-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Missive Style Form */
.form-container.missive-style {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.missive-style .form-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.missive-style .form-header .asana-icon img {
    border-radius: 50%;
}

.missive-style .form-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

/* Form groups style compact */
.missive-style .form-group {
    margin-bottom: 12px;
}

/* Labels style Missive - petits et gris */
.missive-style .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Inputs et selects style Missive - plus compacts */
.missive-style .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    min-height: 36px;
}

.missive-style .form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.missive-style .form-control::placeholder {
    color: #666;
}

.missive-style textarea.form-control {
    resize: vertical;
    min-height: 87px;
    padding: 12px;
}

.missive-style input.form-control {
    padding: 10px 12px;
}

/* Form row layout serré comme dans le screenshot */
.missive-style .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.missive-style .form-row .form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.missive-style .form-row .form-group-half label {
    margin-bottom: 6px;
}

/* Buttons style Missive - plus espacés */
.missive-style .form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.missive-style .btn-cancel {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #555;
    padding: 12px 24px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.missive-style .btn-cancel:hover {
    color: #fff;
    border-color: #777;
}

.missive-style .btn-submit {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.missive-style .btn-submit:hover {
    background: #357abd;
}

/* Responsive */
@media (max-width: 480px) {
    .asana-menu {
        padding: 12px;
    }

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

    .form-row {
        flex-direction: column;
    }

    .modal-content, .form-container, .missive-popup-form {
        width: 95%;
        padding: 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .button {
        width: 100%;
        justify-content: center;
    }
}
/* Stock Check Iframe Styles */
.form-container-iframe {
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.form-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: #ffffff;
}

.iframe-wrapper {
    flex: 1;
    overflow: hidden;
    margin: 16px 0;
    border-radius: 8px;
    background: #ffffff;
}

.iframe-wrapper iframe {
    display: block;
}

/* Adjust form actions for iframe view */
.form-container-iframe .form-actions {
    justify-content: center;
    padding-top: 0;
}
