/* Edit Mode Styling */

/* Edit Mode Toggle Button */
.edit-mode-button {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.2s ease, transform 0.1s ease;
}

.edit-mode-button:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.edit-mode-button:active {
    transform: translateY(0);
}

.edit-mode-button.active {
    background: #FF9800;
}

.edit-mode-button.active:hover {
    background: #F57C00;
}

/* Card Remove Button (Minus Button) */
.card-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #f44336;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

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

/* Add Card Slot (Empty Card with Plus Icon) */
.add-card-slot {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 3px dashed #2196F3;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    transition: all 0.3s ease;
    position: relative;
}

.add-card-slot:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    border-color: #1976D2;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.add-card-slot-icon {
    text-align: center;
    color: #2196F3;
    user-select: none;
}

.add-card-slot .plus-icon {
    font-size: 80px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 10px;
}

.add-card-slot .add-card-text {
    font-size: 16px;
    font-weight: bold;
}

.add-card-slot:hover .add-card-slot-icon {
    color: #1976D2;
}

/* Undo Toast Notification */
.undo-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: bottom 0.3s ease;
    min-width: 300px;
    max-width: 500px;
}

.undo-toast.show {
    bottom: 30px;
}

.undo-toast-message {
    flex: 1;
    font-size: 14px;
}

.undo-toast-button {
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.undo-toast-button:hover {
    background: #F57C00;
}

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

/* Add Card Modal */
.add-card-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.add-card-modal.show {
    display: flex;
}

.add-card-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.add-card-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-card-modal .modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.add-card-modal .close-modal-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.add-card-modal .close-modal-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.add-card-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.add-card-modal .search-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.add-card-modal .search-controls input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.add-card-modal .search-controls input:focus {
    outline: none;
    border-color: #2196F3;
}

.add-card-modal .search-controls button {
    padding: 12px 24px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-card-modal .search-controls button:hover {
    background: #1976D2;
}

.add-card-modal .search-controls button:active {
    transform: scale(0.98);
}

.add-card-modal .cards-list-container {
    margin-top: 16px;
}

.add-card-modal .cards-list-container > input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.add-card-modal .cards-list-container > input:focus {
    outline: none;
    border-color: #2196F3;
}

.add-card-modal .cards-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
}

.add-card-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.add-card-modal .primary-button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-card-modal .primary-button:hover {
    background: #45a049;
}

.add-card-modal .primary-button:active {
    transform: scale(0.98);
}

.add-card-modal .secondary-button {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-card-modal .secondary-button:hover {
    background: #e0e0e0;
}

.add-card-modal .secondary-button:active {
    transform: scale(0.98);
}

/* Status message in modal */
.add-card-modal .fetch-status {
    font-weight: bold;
    padding: 8px 0;
    font-size: 14px;
    min-height: 24px;
}

.add-card-modal .fetch-status.loading {
    color: #2196F3;
}

.add-card-modal .fetch-status.success {
    color: #4CAF50;
}

.add-card-modal .fetch-status.warning {
    color: #FF9800;
}

.add-card-modal .fetch-status.error {
    color: #f44336;
}

/* Collection Header: Filters + Actions Layout */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.collection-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.collection-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* Action Button Styling (for Add from Photo button) */
.action-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-button:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.action-button:active {
    transform: translateY(0);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .add-card-modal .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .add-card-modal .modal-header h2 {
        font-size: 20px;
    }

    .add-card-modal .search-controls {
        flex-direction: column;
    }

    .add-card-modal .modal-footer {
        flex-direction: column;
    }

    .add-card-modal .primary-button,
    .add-card-modal .secondary-button {
        width: 100%;
    }

    .undo-toast {
        min-width: 280px;
        max-width: 90%;
        padding: 12px 16px;
    }

    .undo-toast-message {
        font-size: 13px;
    }

    .undo-toast-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .card-remove-btn {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}
