/* Smart Finance Hub - Main Stylesheet */

/* 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: #f8fafc;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: #2d3748;
    margin-bottom: 1rem;
}

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

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #5a67d8;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

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

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    border-bottom-color: white;
    opacity: 0.9;
}

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

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.cta-button {
    background: #ff6b6b;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: #667eea;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Main Content */
main {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* Article Cards - Uniform Design */
.article-card, .uniform-article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
}

.article-card:hover, .uniform-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Card Grid Layout */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin: 2rem 0;
}

/* Image Container */
.article-card .image-container, .uniform-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f7fafc;
    position: relative;
}

.article-card .image-container img, .uniform-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .image-container img, .uniform-article-card:hover .uniform-image-container img {
    transform: scale(1.05);
}

/* Card Content */
.article-card .card-content, .uniform-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title Styling */
.article-card h2, .uniform-article-title {
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8rem;
}

/* Meta Information */
.article-meta, .uniform-article-meta {
    color: #718096;
    font-size: 0.875rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-meta .date, .article-meta .reading-time,
.uniform-article-meta .date, .uniform-article-meta .reading-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Excerpt Text */
.article-excerpt, .uniform-article-excerpt {
    line-height: 1.6;
    color: #4a5568;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-bottom: 16px;
}

/* Call to Action Area */
.card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.read-more, .uniform-read-more-btn {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more:hover, .uniform-read-more-btn:hover {
    color: #5a67d8;
    transform: translateX(2px);
}

.read-more::after, .uniform-read-more-btn::after {
    content: "→";
    transition: transform 0.3s ease;
}

.read-more:hover::after, .uniform-read-more-btn:hover::after {
    transform: translateX(2px);
}

/* Category Badge */
.category-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

/* Author Info */
.author-info {
    color: #718096;
    font-size: 0.8rem;
    margin-top: 8px;
    font-style: italic;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.newsletter h3 {
    margin-bottom: 1rem;
    color: white;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter input {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
}

.newsletter button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.newsletter button:hover {
    background: #5a67d8;
}

/* Ad Banners */
.ad-banner {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 1.5rem 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    border: 2px solid rgba(255,255,255,0.3);
}

.ad-banner:hover {
    transform: scale(1.02);
}

.ad-banner h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.comparison-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.comparison-table tr:hover {
    background: #f7fafc;
}

/* Highlight Boxes */
.highlight-box {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.warning-box {
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

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

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Footer */
footer {
    background: #2d3748;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.disclaimer {
    font-size: 0.85rem;
    margin-top: 1rem;
    color: #a0aec0;
    line-height: 1.5;
}

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

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

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

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.font-bold { font-weight: bold; }
.font-semibold { font-weight: 600; }

.text-primary { color: #667eea; }
.text-success { color: #38a169; }
.text-warning { color: #f6ad55; }
.text-danger { color: #e53e3e; }

.bg-primary { background-color: #667eea; }
.bg-success { background-color: #38a169; }
.bg-warning { background-color: #f6ad55; }
.bg-danger { background-color: #e53e3e; }

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .article-card .card-content, .uniform-card-content {
        padding: 20px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-card, .uniform-article-card {
        min-height: 400px;
    }
    
    .content-section {
        padding: 2rem 1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter button {
        margin-top: 0.5rem;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .article-card .card-content, .uniform-card-content {
        padding: 16px;
    }

    .article-card, .uniform-article-card {
        min-height: 360px;
    }

    .article-card .image-container, .uniform-image-container {
        height: 180px;
    }
    
    .content-section {
        padding: 1.5rem 1rem;
    }
}

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

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

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.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;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

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