/**
 * Question Cart Styles
 * Minimal and professional design for question cart system
 */

/* ==================== Floating Cart Button ==================== */
.question-cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.cart-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.cart-button.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(0.9); }
}

.cart-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cart-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-button:hover + .cart-tooltip {
    opacity: 1;
}

/* ==================== Add to Cart Buttons ==================== */
.add-to-cart-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
}

.add-to-cart-btn:disabled,
.add-to-cart-btn.in-cart {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.question-card.in-cart,
tr.in-cart {
    border-left: 4px solid #22c55e;
    background: linear-gradient(to right, rgba(34, 197, 94, 0.05), transparent);
}

/* Table row in cart styling */
tr.in-cart td {
    position: relative;
}

tr.in-cart td:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #22c55e;
}

/* ==================== Cart Modal ==================== */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cart-modal-overlay.hidden {
    display: none;
}

.cart-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Modal Header */
.cart-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-header h2 i {
    color: #22c55e;
}

.cart-count-badge {
    background: #22c55e;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Statistics */
.cart-stats {
    padding: 16px 24px;
    background: #f9fafb;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Controls */
.cart-controls {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
}

.cart-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.cart-search-input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.cart-sort-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.cart-sort-select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Items Container */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    min-height: 200px;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.cart-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.cart-empty p {
    margin: 8px 0;
}

.cart-empty .text-sm {
    font-size: 13px;
    color: #9ca3af;
}

/* Cart Table */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table thead th {
    text-align: left;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e7eb;
}

.cart-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.cart-table tbody tr:hover {
    background: #f9fafb;
}

.cart-table tbody td {
    padding: 12px 8px;
    font-size: 14px;
    color: #374151;
}

.question-preview {
    line-height: 1.4;
}

.btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #fee2e2;
}

/* Actions */
.cart-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.action-group {
    display: flex;
    gap: 8px;
}

.cart-actions button {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-info {
    background: #06b6d4;
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ==================== Notifications ==================== */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.cart-notification.show {
    transform: translateX(0);
}

.cart-notification.success {
    border-left: 4px solid #22c55e;
}

.cart-notification.success i {
    color: #22c55e;
}

.cart-notification.error {
    border-left: 4px solid #ef4444;
}

.cart-notification.error i {
    color: #ef4444;
}

.cart-notification.warning {
    border-left: 4px solid #f59e0b;
}

.cart-notification.warning i {
    color: #f59e0b;
}

.cart-notification.info {
    border-left: 4px solid #3b82f6;
}

.cart-notification.info i {
    color: #3b82f6;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .cart-modal {
        max-width: 100%;
        margin: 10px;
    }
    
    .cart-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .action-group {
        width: 100%;
        flex-direction: column;
    }
    
    .action-group button {
        width: 100%;
        justify-content: center;
    }
    
    .cart-table {
        font-size: 12px;
    }
    
    .cart-table thead th,
    .cart-table tbody td {
        padding: 8px 4px;
    }
    
    .question-cart-fab {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .cart-header h2 {
        font-size: 18px;
    }
    
    .cart-controls {
        flex-direction: column;
    }
    
    .cart-search-input,
    .cart-sort-select {
        width: 100%;
    }
}