/* Custom styles for PricePilot */
body {
    min-width: 384px;
    max-width: 384px;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
}

/* Modern Toggle Switch */
input[type="checkbox"]:checked + div {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input[type="checkbox"]:checked + div .dot {
    transform: translateX(100%);
}

.dot {
    transition: transform 0.3s ease;
}

/* Enhanced Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Compact Mode Enhancements */
.compact-mode {
    font-size: 0.875rem !important; /* Smaller base font */
    line-height: 1.3 !important;
}

.compact-mode .container {
    padding: 0.5rem !important;
}

.compact-mode .space-y-2 > * + * {
    margin-top: 0.25rem !important;
}

.compact-mode .space-y-3 > * + * {
    margin-top: 0.375rem !important;
}

.compact-mode .space-y-4 > * + * {
    margin-top: 0.5rem !important;
}

.compact-mode .space-y-6 > * + * {
    margin-top: 0.75rem !important;
}

/* Compact Product Cards */
.compact-mode .product-card {
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 0.5rem !important;
}

.compact-mode .product-card .product-image {
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 0.375rem !important;
}

.compact-mode .product-card .product-title {
    font-size: 0.875rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.25rem !important;
}

.compact-mode .product-card .current-price {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
}

.compact-mode .product-card .price-indicator {
    font-size: 0.625rem !important;
    padding: 0.125rem 0.375rem !important;
}

.compact-mode .product-card .last-checked {
    font-size: 0.75rem !important;
    margin-top: 0.125rem !important;
}

/* Compact Buttons */
.compact-mode button {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    border-radius: 0.375rem !important;
}

.compact-mode .btn-primary {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
}

.compact-mode .btn-secondary {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
}

/* Compact Tabs */
.compact-mode .tab-button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.375rem !important;
}

/* Compact Headers */
.compact-mode h1, .compact-mode h2, .compact-mode h3 {
    margin-bottom: 0.5rem !important;
}

.compact-mode h1 {
    font-size: 1.25rem !important;
}

.compact-mode h2 {
    font-size: 1.125rem !important;
}

.compact-mode h3 {
    font-size: 1rem !important;
}

/* Compact Form Elements */
.compact-mode input, .compact-mode select, .compact-mode textarea {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.375rem !important;
}

/* Compact Spacing */
.compact-mode .p-4 {
    padding: 0.75rem !important;
}

.compact-mode .p-6 {
    padding: 1rem !important;
}

.compact-mode .mb-4 {
    margin-bottom: 0.75rem !important;
}

.compact-mode .mb-6 {
    margin-bottom: 1rem !important;
}

.compact-mode .gap-4 {
    gap: 0.75rem !important;
}

.compact-mode .gap-6 {
    gap: 1rem !important;
}

/* Compact Grid */
.compact-mode .grid-cols-1 {
    gap: 0.5rem !important;
}

.compact-mode .grid-cols-2 {
    gap: 0.5rem !important;
}

.compact-mode .grid-cols-3 {
    gap: 0.5rem !important;
}

.compact-mode .grid-cols-4 {
    gap: 0.5rem !important;
}

/* Compact Modal */
.compact-mode .modal-content {
    padding: 1rem !important;
    border-radius: 0.5rem !important;
}

.compact-mode .modal-header {
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

/* Compact Analytics */
.compact-mode .stat-card {
    padding: 1rem !important;
    border-radius: 0.5rem !important;
}

.compact-mode .stat-value {
    font-size: 1.25rem !important;
}

.compact-mode .stat-label {
    font-size: 0.75rem !important;
}

/* Compact Charts */
.compact-mode .chart-container {
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
}

.compact-mode .chart-wrapper {
    height: 200px !important;
}

/* Compact Settings */
.compact-mode .bg-white {
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
}

.compact-mode .collapsible-content {
    padding: 0.75rem !important;
}

/* Compact Icons */
.compact-mode svg {
    width: 0.875em !important;
    height: 0.875em !important;
}

.compact-mode .w-4 {
    width: 0.875rem !important;
}

.compact-mode .h-4 {
    height: 0.875rem !important;
}

.compact-mode .w-6 {
    width: 1.25rem !important;
}

.compact-mode .h-6 {
    height: 1.25rem !important;
}

/* Tab Enhancements */
.tab-button {
    transition: all 0.3s ease;
}

/* Compact Mode Details Expansion */
.product-details.expanded {
    display: block !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 0 0 0.75rem 0.75rem;
    animation: slideDown 0.3s ease;
}

.product-details.hidden {
    display: none !important;
}

.tab-button:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px);
}

.tab-button.active {
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Collapsible Animation Enhancements */
.collapsible-content {
    display: none;
    transition: all 0.3s ease;
}

.collapsible-content.expanded {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Density Toggle */
.density-toggle button:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}

/* Rotation utilities */
.rotate-180 {
    transform: rotate(180deg);
}

.transform {
    transform: translateZ(0);
}

.transition-transform {
    transition: transform 0.2s ease;
}

/* Enhanced Prediction Styles */
.prediction-summary {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
}

.prediction-summary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(168, 85, 247, 0.1) 100%) !important;
    transform: translateY(-1px);
}

.prediction-details {
    transition: all 0.3s ease;
}

.prediction-details.hidden {
    display: none;
}

.prediction-arrow {
    transition: transform 0.2s ease;
}

/* Line clamp utility for truncating text */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.4;
    max-height: 2.8em;
}

/* Enhanced Product Card Styles */
.product-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Enhanced Button Styles */
button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.95);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

/* Price history chart container */
.price-history {
    position: relative;
    margin: 1rem 0;
    min-height: 140px; /* Ensure container has enough height for chart + labels */
    display: block; /* Ensure it's visible */
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Empty state animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Enhanced Empty State */
#emptyState {
    animation: fadeIn 0.5s ease;
}

/* Modern Badge Styles */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.tier-free {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.tier-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tier-enterprise {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.subscription-status {
    animation: pulse 2s infinite;
}

/* Enhanced Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Limit reached styling */
.limit-reached {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
}

.pro-feature-prompt {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

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

.upgrade-prompt-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upgrade-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Modal Styles */
#upgrade-modal {
    animation: modalSlideIn 0.3s ease;
}

#upgrade-modal .bg-white {
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

/* Enhanced Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    color: white;
    font-weight: 600;
    z-index: 9999;
    animation: notificationSlideIn 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Feature Preview Styles */
.feature-preview {
    position: relative;
    overflow: hidden;
}

.feature-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
    border-radius: inherit;
}

.feature-preview .pro-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

/* Enhanced Product Card Specific Styles */
.product-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card h3 {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .refresh-btn,
.product-card .delete-btn,
.product-card .view-history-btn {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.product-card .refresh-btn:hover,
.product-card .delete-btn:hover,
.product-card .view-history-btn:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card .flex {
    align-items: center;
    gap: 0.75rem;
}

.product-card .flex-1 {
    min-width: 0;
} 

/* Product Management Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Bulk Selection Styles */
.bulk-select-container {
    transition: all 0.3s ease;
}

.product-checkbox {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.product-checkbox:focus {
    ring: 2px;
    ring-color: #3b82f6;
    ring-offset: 2px;
}

/* Enhanced Product Card Styles */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.product-card.bulk-selected {
    border: 2px solid #3b82f6;
    background-color: #eff6ff;
}

/* Modal Form Styles */
.modal-form-group {
    margin-bottom: 1rem;
}

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

.modal-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.modal-form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Modal Button Styles */
.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-btn-secondary {
    background: #6b7280;
    color: white;
}

.modal-btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: #ef4444;
    color: white;
}

.modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Bulk Operations Bar */
.bulk-operations-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

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

/* Product Category Badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-electronics {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.category-clothing {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
}

.category-home {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.category-books {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.category-sports {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.category-toys {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.category-automotive {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.category-health {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.category-other {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
}

/* Tag Styles */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag {
    background: #e5e7eb;
    color: #374151;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Enhanced Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Modal */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Enhanced Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-left: 4px solid;
    animation: toastSlideIn 0.3s ease-out;
    pointer-events: auto;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.warning {
    border-left-color: #f59e0b;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
} 