/* ToolsLover.com Custom Styles */

/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
    transition: var(--transition);
}

/* Mobile App Bar */
.mobile-app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
}

/* Desktop Navigation */
.desktop-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Header Search */
.nav-search {
    min-width: 220px;
    max-width: 280px;
}

.nav-search .input-group {
    background-color: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.nav-search .input-group-text {
    border: none;
    background: transparent;
    padding-left: 0.75rem;
}

.nav-search .form-control {
    border: none;
    box-shadow: none;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.875rem;
}

.nav-search .form-control:focus {
    border: none;
    box-shadow: none;
}

.search-results-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 1050;
}

@media (max-width: 991.98px) {
    .nav-search {
        min-width: 180px;
        max-width: 220px;
    }
}

.search-results-list {
    padding: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

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

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

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

.search-result-info a {
    color: var(--dark-color);
    text-decoration: none;
}

.search-result-info a:hover {
    color: var(--primary-color);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    height: 60px;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-link {
    color: #6b7280;
    transition: var(--transition);
    border-radius: 0;
}

.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.2rem;
}

/* Add padding for mobile navigation */
body {
    padding-top: 56px;
}

@media (min-width: 768px) {
    body {
        padding-top: 0;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 60px;
    }
    
    main {
        padding-top: 1rem !important;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    box-shadow: var(--shadow);
    background: white;
}

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

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

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

.product-body {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.product-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Home Blog Cards (reuse blog styles) */
.blog-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

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

.blog-card-image-link {
    display: block;
}

.blog-card-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
}

.blog-card-image-placeholder {
    background-color: #f3f4f6;
}

.blog-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.blog-card-title a {
    color: #111827;
    text-decoration: none;
}

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

.blog-card-excerpt {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.product-category {
    display: inline-block;
    background-color: var(--light-color);
    color: #6b7280;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* Mobile Product Cards */
@media (max-width: 767.98px) {
    .product-card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-body {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Cart Page */
.cart-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.cart-item:hover {
    box-shadow: var(--shadow-lg);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-summary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
}

/* Checkout Page */
.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.checkout-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.checkout-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.checkout-step:last-child::before {
    display: none;
}

.checkout-step.active::before {
    background: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 2;
    font-weight: 600;
}

.checkout-step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.checkout-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

/* Dashboard */
.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

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

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Responsive Utilities */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Dark Mode Support */
[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .cart-item,
[data-theme="dark"] .dashboard-card {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .navbar-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .navbar-light .navbar-brand,
[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: var(--text-primary) !important;
}

/* Print Styles */
@media print {
    .mobile-app-bar,
    .desktop-nav,
    .mobile-bottom-nav,
    .desktop-footer,
    .back-to-top {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
    }
}
