/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-outline:hover {
    background-color: #2563eb;
    color: white;
    text-decoration: none;
}

/* Header */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 0;
}

.main-nav a:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-menu a:hover {
    background-color: #f9fafb;
    color: #2563eb;
}

/* Search */
.header-search {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    align-items: center;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.search-form input {
    border: none;
    background: transparent;
    padding: 8px 12px;
    outline: none;
    width: 200px;
}

.search-form button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #6b7280;
}

.search-form button:hover {
    color: #2563eb;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: #4b5563;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Featured Tools */
.featured-tools {
    padding: 80px 0;
    background-color: #f9fafb;
}

.featured-tools h2 {
    text-align: center;
    margin-bottom: 3rem;
}

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

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
}

.tool-card h3 {
    margin-bottom: 1rem;
}

.tool-card h3 a {
    color: #1f2937;
    text-decoration: none;
}

.tool-card h3 a:hover {
    color: #2563eb;
}

.tool-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.all-tools-link {
    text-align: center;
    margin-top: 2rem;
}

/* All Tools Section */
.all-tools {
    padding: 60px 0;
}

.all-tools h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.tools-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.tool-item {
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.tool-item h4 {
    margin-bottom: 0.5rem;
}

.tool-item h4 a {
    color: #1f2937;
    text-decoration: none;
}

.tool-item h4 a:hover {
    color: #2563eb;
}

.tool-item p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Recent Posts */
.recent-posts {
    padding: 80px 0;
    background-color: #f9fafb;
}

.recent-posts h2 {
    text-align: center;
    margin-bottom: 3rem;
}

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

.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
}

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

.post-content {
    padding: 1.5rem;
}

.post-content h3 {
    margin-bottom: 0.5rem;
}

.post-content h3 a {
    color: #1f2937;
    text-decoration: none;
}

.post-content h3 a:hover {
    color: #2563eb;
}

.post-content p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.read-more {
    color: #2563eb;
    font-weight: 500;
}

.blog-cta {
    text-align: center;
    margin-top: 2rem;
}

/* Benefits Section */
.benefits {
    padding: 80px 0;
}

.benefits h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.benefit {
    text-align: center;
}

.benefit h3 {
    margin-bottom: 1rem;
    color: #2563eb;
}

.benefit p {
    color: #6b7280;
}

/* Calculator Styles */
.calculator-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calculator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.calculator-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.calculate-btn {
    width: 100%;
    padding: 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calculate-btn:hover {
    background-color: #1d4ed8;
}

.results-container {
    background-color: #f9fafb;
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
    display: none;
}

.results-container.show {
    display: block;
}

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

.result-item {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.result-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.cost-breakdown {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.cost-breakdown h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 600;
    border-top: 2px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

/* Footer */
.site-footer {
    background-color: #1f2937;
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: #f9fafb;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: #d1d5db;
    transition: color 0.2s;
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Blog Styles */
.blog-header {
    padding: 60px 0;
    background-color: #f9fafb;
    text-align: center;
}

.blog-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #e5e7eb;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #2563eb;
    color: white;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #f3f4f6;
}

.pagination .current {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Single Post Styles */
.post-header {
    padding: 60px 0;
    text-align: center;
}

.post-meta {
    color: #6b7280;
    margin-bottom: 1rem;
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-content h2,
.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* Admin Styles */
.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-nav a {
    padding: 8px 16px;
    background-color: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    color: #4b5563;
}

.admin-nav a:hover,
.admin-nav a.active {
    background-color: #2563eb;
    color: white;
}

.admin-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.admin-card-header {
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-card-body {
    padding: 1.5rem;
}

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

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
    text-decoration: none;
}

/* Error/Success Messages */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .blog-filters {
        justify-content: center;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .search-form input {
        width: 150px;
    }
    
    .calculator-form {
        padding: 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}
