/* ============================================
   FAWFAEZ TEKNIK - Main Stylesheet
   ============================================ */

/* Base */
:root {
    --primary: #38a169;
    --primary-dark: #2f855a;
    --primary-light: #48bb78;
    --secondary: #4a5568;
    --light: #f7fafc;
    --dark: #1a202c;
    --gray: #a0aec0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--secondary);
    background-color: #f8fafc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

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

a:hover {
    color: var(--primary-dark);
}

/* Main Content */
.main-content {
    min-height: 70vh;
    padding: 2rem 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    overflow: hidden;
}

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

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
}

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

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    padding: 4rem 0;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--secondary);
    max-width: 600px;
}

/* Article Cards */
.article-card .card-body {
    padding: 1.5rem;
}

.article-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.article-meta {
    font-size: 0.875rem;
    color: var(--gray);
}

.article-excerpt {
    color: var(--secondary);
    margin: 1rem 0;
}

/* Product Cards */
.product-card .card-body {
    padding: 1.5rem;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
}

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

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

/* Sidebar */
.sidebar-widget {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.sidebar-widget h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
}

/* Tags */
.tag-cloud a {
    display: inline-block;
    background: var(--light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   DETAIL PAGE STYLES
   ============================================ */

/* Article Detail */
.article-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 80px;
}

.article-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 80px;
}

.article-body p {
    margin-bottom: 1rem;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--light);
    border-radius: 0 8px 8px 0;
    color: var(--secondary);
    font-style: italic;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-body ul li,
.article-body ol li {
    margin-bottom: 0.5rem;
}

.article-body .info-box {
    background: #ebf8ff;
    border-left: 4px solid #3182ce;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-body .warning-box {
    background: #fffbeb;
    border-left: 4px solid #d69e2e;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-body .success-box {
    background: #f0fff4;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.article-body table th {
    background: #f7fafc;
    font-weight: 600;
}

.article-body table tr:nth-child(even) {
    background: #fafafa;
}

.article-body table tr:hover {
    background: #f0fff4;
}

/* Table of Contents */
.toc {
    background: var(--light);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.toc h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc ul li {
    padding: 0.25rem 0;
}

.toc ul li a {
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.toc ul li a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

/* Product Detail */
.product-gallery .main-image-wrapper {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 1rem;
}

.product-gallery .thumbnail {
    transition: all 0.3s;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
}

.product-gallery .thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.2);
}

.product-gallery .thumbnail:hover {
    transform: scale(1.05);
}

.specifications {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--radius);
}

.specifications ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.specifications ul li {
    margin-bottom: 0.5rem;
}

.specifications ul li:last-child {
    margin-bottom: 0;
}

/* Share Buttons */
.share-buttons .btn {
    border-radius: 20px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.share-buttons .btn:hover {
    transform: translateY(-2px);
}

/* Search Results */
.search-result-item {
    transition: all 0.3s;
    border-left: 4px solid transparent;
    border-radius: var(--radius);
}

.search-result-item:hover {
    border-left-color: var(--primary);
    box-shadow: var(--shadow);
}

.search-form-wrapper {
    background: #f8fafc;
    padding: 2rem;
    border-radius: var(--radius);
}

/* Category Header */
.category-header {
    background: #f8fafc;
    padding: 2rem;
    border-radius: var(--radius);
}

.category-header .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Tag Header */
.tag-header {
    background: #f0fff4;
    padding: 2rem;
    border-radius: var(--radius);
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
}

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

.page-item.active .page-link {
    background-color: var(--primary);
    color: white;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .article-body table {
        font-size: 0.8rem;
    }
    
    .article-body table th,
    .article-body table td {
        padding: 0.5rem;
    }
    
    .search-form-wrapper {
        padding: 1.5rem;
    }
    
    .category-header,
    .tag-header {
        padding: 1.5rem;
    }
    
    .toc {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .search-result-item .d-flex {
        flex-direction: column;
    }
    
    .search-result-item img {
        width: 100% !important;
        height: 150px !important;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s ease-in-out infinite;
}

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

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .sidebar {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .article-content {
        box-shadow: none !important;
        padding: 0 !important;
    }
}