/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translate3d(-30px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Main Layout Styles */
body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow-x: hidden;
    min-width: 320px;
}

/* Navbar Styles */
.navbar {
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.98) !important;
}

.navbar-brand {
    padding: 0;
    margin-right: 3rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    height: 46px;
    width: auto;
    filter: none;
}

.navbar-nav .nav-item {
    margin-right: 1rem;
}

.navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(1, 47, 179, 0.1), transparent);
    transition: left 0.5s;
}

.navbar-nav .nav-link:hover::before {
    left: 100%;
}

.navbar-nav .nav-link:hover {
    color: #012FB3 !important;
    background: rgba(1, 47, 179, 0.05);
    transform: translateY(-2px);
}

.navbar-nav .active .nav-link {
    color: #012FB3 !important;
    background: rgba(1, 47, 179, 0.1);
}

.nav-buttons .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.nav-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hero and Search Section */
.hero-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: clamp(40px, 8vh, 80px) 0 clamp(30px, 6vh, 60px);
    margin-top: 76px;
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(1, 47, 179, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section h1 {
    color: #333;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section .lead {
    color: #666;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Search Form */
#searchForm {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 15px);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

#searchForm .input-group {
    border: 2px solid #012FB3;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(1, 47, 179, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    position: relative;
}

#searchForm .input-group.focused {
    box-shadow: 0 8px 35px rgba(1, 47, 179, 0.25);
    transform: translateY(-3px);
}

#searchForm .form-control {
    border: none;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.75rem);
    height: clamp(48px, 8vw, 58px);
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    line-height: 1.5;
    background: transparent;
    transition: all 0.3s ease;
}

#searchForm .form-control:focus {
    box-shadow: none;
    background: rgba(1, 47, 179, 0.02);
}

#searchForm .btn {
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, #012FB3 0%, #1E43B0 100%);
    color: white;
    border: none;
    min-width: clamp(100px, 20vw, 140px);
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

#searchForm .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#searchForm .btn:hover::before {
    left: 100%;
}

#searchForm .btn:hover {
    background: linear-gradient(135deg, #1E43B0 0%, #012FB3 100%);
    transform: translateX(-3px);
}

#searchForm .btn:active {
    transform: scale(0.98);
}

/* Blog Grid Layout */
.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    padding: 0 15px;
}

/* Blog Cards - Simplified without modal */
.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(1, 47, 179, 0.05);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    position: relative;
    height: fit-content;
}

.blog-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 60px rgba(1, 47, 179, 0.15);
    border-color: rgba(1, 47, 179, 0.1);
}

.blog-card:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.2s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Image Container - Simplified */
.blog-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.blog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Updated Category Badges for Multiple Categories */
.blog-categories {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 30px);
}

.blog-category {
    background: linear-gradient(135deg, #012FB3 0%, #1E43B0 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(1, 47, 179, 0.3);
    white-space: nowrap;
}

.blog-category:nth-child(2) {
    background: linear-gradient(135deg, #6610f2 0%, #8b5a2b 100%);
    box-shadow: 0 2px 8px rgba(102, 16, 242, 0.3);
}

.blog-category:nth-child(3) {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.blog-category:nth-child(4) {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Blog Content */
.blog-content {
    padding: 25px;
}

.blog-title {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-title {
    color: #012FB3;
}

.blog-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #666;
}

.blog-writer {
    font-weight: 600;
    color: #012FB3;
}

.blog-designer {
    font-weight: 600;
    color: #6610f2;
}

.blog-date {
    color: #666;
}

.blog-read-time {
    color: #999;
}

.blog-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    background: linear-gradient(135deg, #012FB3 0%, #1E43B0 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.read-more-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 47, 179, 0.3);
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeInUp 0.6s ease-out;
    grid-column: 1 / -1;
}

.empty-state h3 {
    color: #012FB3;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.empty-state p {
    color: #666;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .blogs-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 25px;
        padding: 0 10px;
    }

    .hero-section {
        margin-top: 70px;
        padding: 60px 0 40px;
    }
}

@media (max-width: 991px) {
    .hero-section {
        padding: 50px 0 35px;
        margin-top: 70px;
        margin-bottom: 40px;
    }

    .hero-section h1 {
        font-size: clamp(1.6rem, 4.5vw, 2.8rem);
    }

    .hero-section .lead {
        font-size: clamp(0.95rem, 2.2vw, 1.2rem);
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

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

    #searchForm {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .hero-section {
        padding: 40px 0 30px;
        margin-bottom: 30px;
    }

    .hero-section h1 {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
        margin-bottom: 0.8rem;
    }

    .hero-section .lead {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        margin-bottom: 1.8rem;
        padding: 0 1.5rem;
    }

    .blogs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .blog-card {
        margin-bottom: 0;
        border-radius: 16px;
    }

    .blog-image-container {
        height: 200px;
    }

    .blog-content {
        padding: 20px;
    }

    .blog-meta {
        grid-template-columns: 1fr;
        gap: 8px;
        font-size: 0.8rem;
    }

    .blog-title {
        font-size: clamp(1rem, 4vw, 1.3rem);
        margin-bottom: 12px;
        -webkit-line-clamp: 3;
    }

    .blog-description {
        font-size: clamp(0.8rem, 3vw, 0.9rem);
        -webkit-line-clamp: 2;
        margin-bottom: 15px;
    }

    .read-more-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        border-radius: 20px;
    }

    .blog-categories {
        max-width: calc(100% - 20px);
        gap: 4px;
        top: 12px;
        left: 12px;
    }

    .blog-category {
        font-size: 0.65rem;
        padding: 3px 8px;
        border-radius: 12px;
    }

    #searchForm .input-group {
        border-radius: 25px;
    }

    #searchForm .form-control {
        height: clamp(44px, 8vw, 52px);
        font-size: clamp(0.85rem, 3vw, 1rem);
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    }

    #searchForm .btn {
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(1rem, 4vw, 1.8rem);
        min-width: clamp(80px, 18vw, 120px);
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    }

    .empty-state {
        padding: 60px 15px;
    }

    .empty-state h3 {
        font-size: 1.3rem;
    }

    .empty-state p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 30px 0 25px;
        margin-bottom: 25px;
    }

    .hero-section h1 {
        font-size: clamp(1.3rem, 7vw, 1.8rem);
        margin-bottom: 0.6rem;
    }

    .hero-section .lead {
        font-size: clamp(0.85rem, 4vw, 1rem);
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .blogs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }

    .blog-card {
        border-radius: 12px;
    }

    .blog-image-container {
        height: 180px;
        border-radius: 12px 12px 0 0;
    }

    .blog-content {
        padding: 15px;
    }

    .blog-title {
        font-size: clamp(0.95rem, 4.5vw, 1.2rem);
        margin-bottom: 10px;
        line-height: 1.2;
    }

    .blog-meta {
        gap: 6px;
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .blog-meta span {
        display: block;
        margin-bottom: 4px;
    }

    .blog-description {
        font-size: clamp(0.75rem, 3.5vw, 0.85rem);
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .read-more-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
        border-radius: 15px;
    }

    .blog-categories {
        gap: 3px;
        top: 10px;
        left: 10px;
    }

    .blog-category {
        font-size: 0.6rem;
        padding: 2px 6px;
        border-radius: 10px;
    }

    #searchForm .input-group {
        border-radius: 25px;
    }

    #searchForm .form-control {
        height: clamp(44px, 8vw, 52px);
        font-size: clamp(0.85rem, 3vw, 1rem);
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    }

    #searchForm .btn {
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(1rem, 4vw, 1.8rem);
        min-width: clamp(80px, 18vw, 120px);
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    }

    .empty-state {
        padding: 60px 15px;
    }

    .empty-state h3 {
        font-size: 1.3rem;
    }

    .empty-state p {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .hero-section {
        padding: 25px 0 20px;
    }

    .blogs-grid {
        padding: 0 5px;
        gap: 12px;
    }

    .blog-content {
        padding: 12px;
    }

    .blog-image-container {
        height: 160px;
    }

    .blog-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .blog-meta {
        font-size: 0.7rem;
        gap: 4px;
    }

    .blog-description {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .read-more-btn {
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    #searchForm .form-control {
        height: 40px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    #searchForm .btn {
        padding: 0.4rem 1rem;
        min-width: 80px;
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .blog-card:hover {
        transform: none;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    }

    .blog-card:hover .blog-image {
        transform: none;
    }

    .blog-card:hover .blog-title {
        color: #333;
    }

    .read-more-btn:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(1, 47, 179, 0.2);
    }

    #searchForm .btn:hover {
        transform: none;
    }

    #searchForm .input-group:hover {
        transform: none;
    }
}

/* Landscape phone orientation */
@media (max-width: 812px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 0 15px;
        margin-bottom: 20px;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section .lead {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .blog-image-container {
        height: 140px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .blogs-grid {
        padding: 0 2px;
    }

    .blog-content {
        padding: 10px;
    }

    .blog-title {
        font-size: 0.9rem;
    }

    .blog-meta {
        font-size: 0.65rem;
    }

    .blog-description {
        font-size: 0.75rem;
    }
}

/* Profile link styles */
.writer-link,
.designer-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.writer-link:hover {
    color: #012FB3;
    text-decoration: none;
    border-bottom-color: #012FB3;
}

.designer-link:hover {
    color: #6610f2;
    text-decoration: none;
    border-bottom-color: #6610f2;
}

.writer-link:focus,
.designer-link:focus {
    outline: 2px solid #012FB3;
    outline-offset: 2px;
}

/* Prevent card click when clicking on profile links */
.writer-link,
.designer-link {
    position: relative;
    z-index: 2;
}