/* style.css  */

/* ========================================
   Global Variables and Reset
   ======================================== */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --dark-bg: #1e293b;
    --dark-bg-light: #334155;
    --dark-text: #94a3b8;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.2s ease;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   Container and Layout
   ======================================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main {
    flex: 1;
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

/* ========================================
   Header Styles
   ======================================== */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.logo i {
    color: var(--primary-color);
    font-size: 1.6rem;
    transition: var(--transition);
}

.logo:hover i {
    transform: rotate(5deg);
}

.logo span {
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link i {
    font-size: 0.875rem;
    opacity: 0.7;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

.nav-link:hover i,
.nav-link.active i {
    opacity: 1;
}

/* ========================================
   Footer Styles
   ======================================== */
.footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--dark-text);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom {
    text-align: center;
}

.copyright {
    font-size: 0.875rem;
    color: var(--dark-text);
}

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

.copyright a:hover {
    text-decoration: underline;
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

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

.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: translateY(0);
}

/* ========================================
   Search Bar Styles
   ======================================== */
.search-container {
    margin: 1.5rem auto 2rem;
    max-width: 800px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
    font-size: 1rem;
}

/* Search Clear Button */
.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
}

.search-clear:hover {
    color: var(--error);
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ========================================
   Message Styles
   ======================================== */
.error-message,
.success-message,
.info-message,
.warning-message {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.info-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.warning-message {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* ========================================
   Pagination Styles
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.pagination-link:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

.pagination-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   Homepage Blog Layout
   ======================================== */
.blog-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.blog-post {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    transition: var(--transition);
}

.blog-post:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.post-image {
    width: 120px;
    flex-shrink: 0;
}

.post-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
    flex: 1;
}

.post-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    transition: var(--transition-fast);
}

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

.post-meta {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.post-meta span {
    display: inline-block;
    margin-right: 1rem;
}

.post-meta i {
    margin-right: 0.25rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .post-meta span {
        display: block;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-link {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    .search-container {
        margin: 1rem auto 1.5rem;
        padding: 0 1rem;
    }
    
    .search-form {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .search-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .nav-link i {
        display: none;
    }
    
    .post-image {
        width: 100px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ========================================
   Accessibility
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}