/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6b7280;
    --accent-primary: #8b5cf6;
    --accent-secondary: #3b82f6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    --accent-info: #06b6d4;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.7);
}

body.dark-mode {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

body.light-mode {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
}

/* Typography */
.text-gradient {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.navbar {
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hero-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.hero-content {
    padding: 2rem 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Search Card */
.hero-search-container {
    display: flex;
    justify-content: center;
}

.search-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
}

.search-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.search-title i {
    color: var(--accent-primary);
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

#searchInput {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--bg-gradient);
    border: none;
    border-radius: 16px;
    padding: 20px 32px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.search-suggestions {
    text-align: center;
}

.suggestions-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Loading */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.loading-animation {
    margin-bottom: 2rem;
    position: relative;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

.loading-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.loading-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.loading-progress {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--bg-gradient);
    animation: progressLoad 2s ease-in-out;
}

/* Results Section */
.results-section {
    padding: 100px 0;
    display: none;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.product-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    padding: 12px 24px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 25px;
}

.product-date {
    color: var(--text-secondary);
    font-size: 1rem;
}

.product-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}

/* Result Cards */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-header h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.card-header i {
    color: var(--accent-primary);
}

.market-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.market-status.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Price Comparison */
.price-comparison {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.price-card {
    flex: 1;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.price-card.highlight {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.price-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.price-source {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.price-arrow {
    padding: 0 2rem;
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.profit-indicator {
    text-align: center;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
}

.profit-label {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.profit-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-success);
    margin-bottom: 0.5rem;
}

.profit-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.profit-badge.positive {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

/* Status Card */
.status-card {
    height: 100%;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
}

.status-item.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-item.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-item.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Platform Prices */
.platform-prices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.platform-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.platform-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.platform-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}

.platform-logo.amazon { background: #ff9900; }
.platform-logo.noon { background: #f37021; }
.platform-logo.carrefour { background: #0046be; }
.platform-logo.lulu { background: #e4002b; }

.platform-details {
    display: flex;
    flex-direction: column;
}

.platform-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.platform-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.platform-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Shipping Methods */
.shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shipping-method {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.shipping-method:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.method-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.method-header i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.method-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: auto;
}

.method-badge.fast {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.method-badge.economic {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-secondary);
}

.method-badge.balanced {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-primary);
}

.method-details {
    display: flex;
    gap: 2rem;
}

.detail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Cost Analysis */
.cost-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.cost-breakdown, .profit-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cost-item, .profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.cost-item {
    border-left: 4px solid var(--accent-primary);
}

.profit-item {
    border-left: 4px solid var(--accent-success);
}

.profit-item.highlight {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--accent-success);
}

.cost-label, .profit-label {
    color: var(--text-secondary);
}

.cost-value, .profit-value {
    font-weight: 600;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.total-label {
    font-weight: 600;
    color: var(--accent-primary);
}

.total-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.profit-percentage {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
}

.profit-percentage.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Cost Distribution */
.cost-distribution {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.distribution-chart {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color) 0% var(--percentage),
        rgba(255, 255, 255, 0.1) var(--percentage) 100%
    );
}

.chart-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 100%);
}

.slice-label {
    position: absolute;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
}

/* Export Guide */
.export-guide {
    margin-top: 1rem;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.guide-step {
    display: flex;
    gap: 1.5rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--bg-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.step-content ul {
    list-style: none;
    padding: 0;
}

.step-content li {
    padding: 0.3rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-right: 1.2rem;
}

.step-content li:before {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--accent-primary);
}

/* Notification */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--accent-success);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    animation: notificationSlide 0.5s ease-out;
}

.notification.show {
    display: flex;
}

.notification.error {
    background: var(--accent-error);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes progressLoad {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes notificationSlide {
    0% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-stats { flex-direction: column; gap: 1rem; }
    .product-header { flex-direction: column; gap: 1rem; }
    .price-comparison { flex-direction: column; gap: 1rem; }
    .price-arrow { transform: rotate(90deg); padding: 1rem 0; }
    .cost-analysis { grid-template-columns: 1fr; }
    .guide-steps { grid-template-columns: 1fr; }
    .method-details { flex-direction: column; gap: 0.5rem; }
}