/**
 * Main Stylesheet - עיצוב ראשי
 * Custom styles for the management system
 */

/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #e94560;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ==================== BASE STYLES ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: var(--radius);
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
    border: none;
}

.btn-accent:hover {
    background: #d63850;
    color: white;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ==================== FORMS ==================== */
.form-control,
.form-select {
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ==================== PRODUCT CARDS ==================== */
.product-card {
    border: none;
    overflow: hidden;
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
}

.product-card .product-image img {
    transition: var(--transition);
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-card .product-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    display: flex;
    gap: 10px;
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.product-card .card-title {
    font-size: 1rem;
    margin-bottom: 10px;
}

.product-card .card-title a {
    color: var(--text-color);
}

.product-card .card-title a:hover {
    color: var(--primary-color);
}

.product-price .price-old {
    text-decoration: line-through;
    color: var(--text-muted);
    margin-left: 10px;
}

.product-price .price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* ==================== CATEGORIES ==================== */
.category-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    height: 200px;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.category-card h5 {
    color: white;
    margin: 0;
    font-weight: 600;
}

/* ==================== SEARCH ==================== */
.search-component {
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-right: 45px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.search-result-item:hover {
    background: var(--light-color);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-left: 15px;
}

.search-result-item h6 {
    margin: 0;
    font-size: 0.9rem;
}

.search-result-item .price {
    color: var(--accent-color);
    font-weight: 600;
}

.search-results .view-all {
    display: block;
    padding: 15px;
    text-align: center;
    background: var(--light-color);
    font-weight: 500;
}

/* ==================== CART WIDGET ==================== */
.cart-widget {
    position: relative;
}

.cart-icon {
    cursor: pointer;
    position: relative;
}

.cart-icon .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 0.7rem;
}

.cart-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 350px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h5 {
    margin: 0;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-left: 15px;
}

.cart-item .item-details {
    flex: 1;
}

.cart-item .item-details h6 {
    margin: 0 0 5px;
    font-size: 0.9rem;
}

.cart-item .item-price {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.cart-item .item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.cart-item .item-qty button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.cart-item .btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.cart-item .btn-remove:hover {
    color: var(--accent-color);
}

.cart-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.cart-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* ==================== PAGINATION ==================== */
.pagination {
    justify-content: center;
}

.pagination .page-link {
    border: none;
    margin: 0 3px;
    border-radius: var(--radius);
    color: var(--text-color);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-color);
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
    border-radius: var(--radius);
}

/* ==================== LOADING ==================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== QUANTITY INPUT ==================== */
.qty-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-input button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.qty-input button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.qty-input input {
    width: 60px;
    text-align: center;
    border-radius: var(--radius);
}

/* ==================== GALLERY ==================== */
.product-gallery {
    display: flex;
    gap: 10px;
}

.product-gallery .main-image {
    flex: 1;
}

.product-gallery .main-image img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.product-gallery .thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80px;
}

.product-gallery .thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

.product-gallery .thumbnails img:hover,
.product-gallery .thumbnails img.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--dark-color);
    color: #b8b8b8;
}

footer h5, footer h6 {
    color: white;
}

footer a {
    color: #b8b8b8;
}

footer a:hover {
    color: white;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .cart-dropdown {
        width: 300px;
        right: 0;
        left: auto;
    }
}

@media (max-width: 767px) {
    .product-card .product-image img {
        height: 200px;
    }
    
    .product-gallery {
        flex-direction: column-reverse;
    }
    
    .product-gallery .thumbnails {
        flex-direction: row;
        width: 100%;
    }
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== ANIMATIONS ==================== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
