/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-text {
    flex: 1;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 12px;
}

.header-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    backdrop-filter: blur(10px);
}

.header-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.main {
    padding: 60px 0;
    min-height: calc(100vh - 300px);
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.error-message {
    color: #dc2626;
    font-weight: 500;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* Card Styles */
.post-card {
    background: var(--card-background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.post-card-tag {
    background-color: #eff6ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.3;
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.7;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-card-author {
    font-weight: 500;
    color: var(--text-primary);
}

.post-card-date {
    color: var(--text-secondary);
}

.post-card-reading-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

.footer p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }

    .header-subtitle {
        font-size: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .main {
        padding: 40px 0;
    }
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Tags Filter Section */
.tags-filter-section {
    margin-bottom: 40px;
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-filter {
    background-color: var(--card-background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.tag-filter:hover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    transform: translateY(-2px);
}

.tag-filter.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.tag-filter.active:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Page Sections */
.page-section {
    animation: fadeIn 0.4s ease;
}

.page-section:not(.active) {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Page Styles - Profile */
.home-content {
    max-width: 900px;
    margin: 0 auto;
}

.profile-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 40px;
    text-align: center;
    color: white;
}

.profile-avatar {
    margin-bottom: 20px;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.profile-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.profile-content {
    padding: 40px;
}

.profile-section {
    margin-bottom: 40px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--background-color);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateX(5px);
}

.info-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.info-text {
    flex: 1;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.info-value {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 600;
}

.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.hobby-card {
    background: var(--background-color);
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.hobby-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.hobby-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.hobby-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.cta-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Responsive Updates */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-nav {
        justify-content: center;
    }

    .profile-header {
        padding: 30px 20px;
    }

    .avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }

    .profile-title {
        font-size: 2rem;
    }

    .profile-subtitle {
        font-size: 1rem;
    }

    .profile-content {
        padding: 25px 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hobbies-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
