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

:root {
    /* Light theme variables */
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #555;
    --border-color: #e1e5e9;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    --header-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --body-gradient: linear-gradient(to top, #a8edea 0%, #fed6e3 100%);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --text-lighter: #c0c0c0;
    --border-color: #404040;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --shadow-heavy: rgba(0, 0, 0, 0.5);
    --header-gradient: linear-gradient(135deg, #4a5fb8 0%, #5a4470 100%);
    --body-gradient: linear-gradient(to top, #30cfd0 0%, #330867 100%);
}

body {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--body-gradient);
    background-attachment: fixed;
    overflow-x: hidden;
    font-weight: 400;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-light);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--shadow-medium);
}

.sun-icon, .moon-icon {
    position: absolute;
    transition: all 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

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

/* Header Styles */
.header {
    text-align: center;
    padding: 60px 0 40px;
    background: var(--header-gradient);
    color: white;
    margin-bottom: 50px;
    border-radius: 0 0 30px 30px;
}

.header-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    font-family: 'Playfair Display', Georgia, serif;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-text-content {
    flex: 1;
    text-align: center;
}

.header-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    font-style: italic;
    font-family: 'Playfair Display', Georgia, serif;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* Loading Styles */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loading p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Error Styles */
.error {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-light);
}

.error p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
}

.retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.hidden {
    display: none;
}

/* Main Content */
.main-content {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Playfair Display', Georgia, serif;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

.articles-count {
    color: var(--text-light);
    font-weight: 500;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
}

/* Carousel Styles */
.carousel-section {
    margin-bottom: 60px;
}

.carousel-controls {
    display: flex;
    gap: 10px;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: var(--card-bg);
    color: #667eea;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
}

.carousel-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow-medium);
}

.carousel {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item {
    flex: 0 0 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: row;
}

[data-theme="dark"] .carousel-item {
    background: rgba(45, 45, 45, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-heavy);
}

.carousel-item .card-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carousel-item:hover .card-image {
    transform: scale(1.05);
}

.carousel-item .card-content {
    padding: 40px;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-item .card-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.2;
    font-family: 'Playfair Display', Georgia, serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.carousel-item .card-excerpt {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.6;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #667eea;
    transform: scale(1.2);
}

/* Grid Styles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Card Styles */
.article-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
}

[data-theme="dark"] .article-card {
    background: rgba(45, 45, 45, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-heavy);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 15px 15px 0 0;
}

.article-card:hover .card-image {
    transform: scale(1.05);
}

.carousel-item .card-image {
    width: 50%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 20px 20px 0;
}

.card-content {
    padding: 25px;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Playfair Display', Georgia, serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-family: 'Playfair Display', Georgia, serif;
}

.card-date {
    font-weight: 500;
    font-style: italic;
    font-family: 'Playfair Display', Georgia, serif;
}

.card-excerpt {
    color: var(--text-lighter);
    margin-bottom: 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: 'Playfair Display', Georgia, serif;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }
.article-card:nth-child(5) { animation-delay: 0.4s; }
.article-card:nth-child(6) { animation-delay: 0.5s; }

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: #000000;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .theme-toggle {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
        font-size: 1.2rem;
    }
    
    .header-title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .carousel-controls {
        order: -1;
    }
    
    .carousel-item {
        flex-direction: column;
    }
    
    .carousel-item .card-content {
        padding: 25px;
        width: 100%;
    }
    
    .carousel-item .card-title {
        font-size: 1.8rem;
    }
    
    .carousel-item .card-image {
        width: 100%;
        height: 250px;
        border-radius: 20px 20px 0 0;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 40px 0 30px;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .carousel-item .card-content {
        padding: 15px;
    }
    
    .carousel-item .card-title {
        font-size: 1.3rem;
    }
}

/* Header Styles start*/

.header-container {
    display: flex;
    justify-content: space-between; /* Space between content and image */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto; /* center container if wider screen */
    padding: 0 20px; /* horizontal padding */
}

.medium-profile-icon {
    border-radius: 50%;
    border: 2px solid #fff;
    background: #fff;
    width: 160px;
    height: 160px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    cursor: pointer;
    display: block; /* Ensure proper display as block element */
}

/* Style for the link wrapper */
.medium-profile-icon-link {
    text-decoration: none;
    display: inline-block;
}

.medium-profile-icon:hover {
    transform: scale(1.08) rotate(-3deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }
  .medium-profile-icon {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .header-container {
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
  }
  .header-text-content {
    order: 1;
  }
  .medium-profile-icon {
    width: 100px;
    height: 100px;
    order: 2;
  }
}


/* Header Styles end*/



/* Background Text */
.background-text {
    position: fixed;
    font-size: 20rem;
    font-weight: 800;
    color: rgba(96, 96, 96, 0.15) ; /* Much higher opacity for light mode */
    bottom: 10%;
    left: -5%;
    transform: none;
    z-index: -1;
    font-family: 'Playfair Display', Georgia, serif;
    pointer-events: none;
    user-select: none;
    line-height: 0.8;
    text-shadow: 15px 15px 3px rgba(152, 237, 251, 0.25) ;
}

.bg-line-1 {
    white-space: nowrap;
    margin-left: 5%; /* Add margin to move "Data" away from the left edge */
}

.bg-line-2 {
    white-space: nowrap;
    margin-left: 15%; /* Position "Dreamer" to the right */
}

/* Dark theme adjustment for background text */
[data-theme="dark"] .background-text {
    color: rgba(152, 237, 251, 0.2); /* Higher opacity for dark mode */
    text-shadow: 8px 8px 2px rgba(96, 96, 96, 0.1); /* Smaller shadow for dark mode */
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }
