/* CSS per dashboard */
/* --- SHAPPA DASHBOARD STYLE INSPIRED BY DROOPIFY --- */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-text: #fff;
    --sidebar-link-active: #fff;
    --sidebar-link: #e0e7ff;
    --sidebar-link-hover: #c7d2fe;
    --dashboard-bg: #f9fafb;
    --card-bg: #fff;
    --card-radius: 16px;
    --card-shadow: 0 4px 24px rgba(60,72,128,0.08);
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

.dashboard-bg {
    background: var(--dashboard-bg);
    min-height: 100vh;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.2rem 1.2rem 1.2rem;
    box-shadow: 0 0 32px rgba(60,72,128,0.10);
    position: relative;
    z-index: 10;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}
.logo-icon {
    font-size: 2rem;
}
.logo-text {
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-link {
    color: var(--sidebar-link);
    text-decoration: none;
    font-weight: 500;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}
.sidebar-link.active,
.sidebar-link:hover {
    background: rgba(255,255,255,0.12);
    color: var(--sidebar-link-active);
    transform: translateX(4px);
}
.sidebar-footer {
    margin-top: 2rem;
}
.sidebar-link.admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245,158,11,0.12);
}

.dashboard-main {
    flex: 1;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.dashboard-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #312e81;
    letter-spacing: -0.02em;
}
.dashboard-actions {
    display: flex;
    gap: 1rem;
}
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px rgba(60,72,128,0.08);
}
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}
.btn-primary:hover {
    background: var(--secondary-gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(60,72,128,0.12);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid #e5e7eb;
    min-height: 90px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
    box-shadow: 0 8px 32px rgba(60,72,128,0.16);
    transform: translateY(-2px) scale(1.02);
}
.stat-icon {
    font-size: 2.2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 0.7rem;
    box-shadow: 0 2px 8px rgba(60,72,128,0.10);
}
.stat-label {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #312e81;
}

.search-section {
    margin-bottom: 2rem;
}
.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(60,72,128,0.08);
    padding: 1.2rem 1.5rem;
    border: 1px solid #e5e7eb;
}
.search-input {
    flex: 1;
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #312e81;
    font-weight: 500;
    transition: border var(--transition), box-shadow var(--transition);
}
.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(60,72,128,0.12);
    outline: none;
}

.results-section {
    margin-top: 2rem;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid #e5e7eb;
    transition: box-shadow var(--transition), transform var(--transition);
    min-height: 320px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.7s cubic-bezier(.4,0,.2,1);
}
.product-card:hover {
    box-shadow: 0 8px 32px rgba(60,72,128,0.16);
    transform: translateY(-2px) scale(1.02);
}
.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(60,72,128,0.08);
}
.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #312e81;
    margin-bottom: 0.3rem;
}
.product-brand {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 500;
}
.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary-color);
}
.product-rating {
    font-size: 1rem;
    color: #f59e0b;
    font-weight: 600;
}
.product-details {
    font-size: 0.95rem;
    color: #6b7280;
    margin-top: 0.2rem;
}
.product-actions {
    display: flex;
    gap: 0.7rem;
    margin-top: auto;
}
.btn-view {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}
.btn-view:hover {
    background: var(--secondary-gradient);
    box-shadow: 0 2px 8px rgba(60,72,128,0.12);
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(24px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Navigation */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.nav-logo h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user span {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* Dashboard Main */
.dashboard-main {
    padding: 2rem;
    min-height: calc(100vh - 80px);
    background: var(--bg-secondary);
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-change.positive { color: var(--success-color); }
.stat-change.negative { color: var(--error-color); }
.stat-change.neutral { color: var(--text-secondary); }

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Activity Section */
.activity-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.activity-card,
.actions-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.activity-card h3,
.actions-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.activity-icon {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.success { background: rgba(16, 185, 129, 0.1); }
.activity-icon.info { background: rgba(6, 182, 212, 0.1); }
.activity-icon.warning { background: rgba(245, 158, 11, 0.1); }

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.activity-content span {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.activity-content time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.action-icon {
    font-size: 1.5rem;
}

.action-btn span:last-child {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-activity {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-activity h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Connection Status */
.connections-status {
    padding: 2rem;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.connection-item:last-child {
    margin-bottom: 0;
}

.connection-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.connection-icon.amazon {
    background: linear-gradient(135deg, #ff9900, #146eb4);
}

.connection-icon.ebay {
    background: linear-gradient(135deg, #0064d2, #86b817);
}

.connection-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.connection-details .status {
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.connection-details .status.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.connection-details .status.disconnected {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-row,
    .activity-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        display: none; /* Mobile menu da implementare */
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Listings Page Styles */
.listings-container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 260px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.sidebar h3 {
    margin-top: 0;
}

.folders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.folder-item {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-item:hover,
.folder-item.active {
    background: #f3f4f6;
    border-color: var(--primary-color);
}

.import-section {
    margin-top: 1rem;
}

.btn-import {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-import:hover {
    background: var(--primary-hover);
}

.table-section {
    flex: 1;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.table-header h3 {
    margin: 0;
}

.table-controls {
    display: flex;
    gap: 0.5rem;
}

.table-search {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.btn-refresh {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: #059669;
}

.btn-monitor {
    background: var(--warning-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-monitor:hover {
    background: #d97706;
}

/* Bulk actions */
.bulk-actions {
    display: none;
    gap: 0.5rem;
}

.btn-delete {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #dc2626;
}

.table-container {
    overflow: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.table th:hover {
    background: rgba(79, 70, 229, 0.05);
}

.table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.table input {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn-list {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-list:hover {
    background: var(--primary-hover);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.pagination label {
    display: flex;
    align-items: center;
}

.pagination select {
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.btn-page {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-page:hover {
    background: var(--bg-hover);
}

.page-info {
    min-width: 80px;
    text-align: center;
}

/* Price indicators */
.price-indicator {
    margin-left: 0.5rem;
    font-weight: bold;
}

.price-indicator.up {
    color: var(--success-color);
}

.price-indicator.down {
    color: var(--error-color);
}

/* Products Page Styles */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.marketplace-selector {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    min-width: 120px;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 2rem;
    border: 2px solid white;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #f3f4f6;
}

.products-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

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

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .marketplace-selector, .search-input, .search-btn {
        width: 100%;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}
