/* Custom Styles for Blog */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    padding-top: 55px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Content */
main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    padding: 0.3rem 0;
    height: 55px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #ffffff !important;
}

.navbar-brand {
    font-size: 1.2rem;
    font-family: 'Georgia', serif !important;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-brand img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem !important;
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: #ffffff;
    color: #333;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 2px solid #f8f9fa;
}

.hero-section .display-4 {
    color: #333;
    text-shadow: none;
}

/* Article Cards */
.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(222, 110, 9, 0.15);
    border-color: #ff9a08;
}

/* Card Image Wrapper */
.card-img-wrapper {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px 10px 0 0;
}

.card-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .card-img {
    transform: translate(-50%, -50%) scale(1.15) rotate(2deg);
}

/* Card Image Placeholder */
.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.8rem;
    gap: 0.5rem;
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .card-overlay {
    opacity: 1;
}

.overlay-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #de6e09;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    animation: bounceIn 0.5s ease;
}

.overlay-link:hover {
    background: #fff;
    color: #ff9a08;
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Card Body */
.article-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #2c3e50;
    min-height: 2.6rem;
}

.card-title a {
    color: #2c3e50;
    transition: color 0.2s ease;
    font-weight: 600;
}

.card-title a:hover {
    color: #de6e09;
}

.card-excerpt {
    font-size: 0.75rem;
    color: #7f8c8d;
    flex-grow: 1;
    margin-bottom: 0.6rem;
    line-height: 1.4;
    min-height: 2.8rem;
}

/* Card Footer Info */
.card-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px solid #ecf0f1;
}

.card-footer-info small {
    color: #95a5a6;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Hero Section Enhancement */
.hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 248, 240, 1) 100%);
    border-bottom: 3px solid #de6e09;
    animation: fadeInDown 0.6s ease;
}

/* Container Flex */
.container {
    flex-grow: 1;
}

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

/* Grid Gap Optimization */
.row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

/* Card Badge */
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.badge-new {
    background: linear-gradient(45deg, #ff9a08, #de6e09);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 10px rgba(222, 110, 9, 0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Read More Link */
.read-more {
    color: #de6e09;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.read-more:hover {
    color: #ff9a08;
    gap: 0.3rem;
}

.read-more i {
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* Card Hover Effect */
.card-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 154, 8, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.article-card:hover .card-hover-effect {
    opacity: 1;
}

/* Bounce Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Shapes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #ff9a08, #de6e09);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* Article Detail */
.article-detail {
    background: white;
    border-radius: 10px;
    padding: 2rem 2.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 100%;
}

.article-image {
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.article-header h1 {
    color: #2c3e50;
    line-height: 1.3;
}

.article-meta {
    font-size: 0.9rem;
}

.article-excerpt {
    font-size: 1.2rem;
    color: #555;
    border-left: 4px solid #ff9a08;
    padding-left: 1rem;
    font-style: italic;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 100%;
    word-wrap: break-word;
}

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

.article-content h2,
.article-content h3,
.article-content h4 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h2 {
    border-bottom: 2px solid #ff9a08;
    padding-bottom: 0.5rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content blockquote {
    border-left: 4px solid #ff9a08;
    padding-left: 1rem;
    font-style: italic;
    color: #555;
    margin: 2rem 0;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.article-content ul,
.article-content ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.article-content th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Footer */
footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #ffffff !important;
    border-top: 2px solid #e9ecef;
}

footer h5, footer h6 {
    color: #333;
    margin-bottom: 0.5rem;
}

footer hr {
    border-color: #e9ecef;
    opacity: 0.5;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Primary Button Override */
.btn-primary {
    background-color: #de6e09 !important;
    border-color: #de6e09 !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #c5620a !important;
    border-color: #c5620a !important;
    color: white !important;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: #b05608 !important;
    border-color: #b05608 !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(222, 110, 9, 0.25) !important;
}

.btn-primary:disabled {
    background-color: #de6e09 !important;
    border-color: #de6e09 !important;
    opacity: 0.65;
}

/* Success Button Override */
.btn-success {
    background-color: #de6e09 !important;
    border-color: #de6e09 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #c5620a !important;
    border-color: #c5620a !important;
    color: white !important;
}

.btn-success:focus,
.btn-success:active,
.btn-success.active {
    background-color: #b05608 !important;
    border-color: #b05608 !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(222, 110, 9, 0.25) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-section .display-4 {
        font-size: 2.5rem;
    }

    .article-detail {
        padding: 1.5rem;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .article-card {
        margin-bottom: 1.5rem;
    }

    .share-buttons .btn {
        margin-bottom: 0.5rem;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .article-detail {
        padding: 2rem;
    }
    
    .article-content {
        font-size: 1.05rem;
    }
}

/* Large Screen Optimization */
@media (min-width: 1400px) {
    .article-detail {
        padding: 2.5rem 3rem;
    }
    
    .article-content {
        font-size: 1.15rem;
        line-height: 1.9;
    }
}

/* Back to Top Button */
.back-to-top {
    font-size: 18px;
    line-height: 1;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
}

.back-to-top i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

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

/* Error Pages */
.error-page {
    text-align: center;
    padding: 5rem 2rem;
}

.error-page h1 {
    font-size: 8rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.error-page h2 {
    color: #495057;
    margin-bottom: 2rem;
}

/* Summernote Customization (for admin) */
.note-editor {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.note-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Admin Panel Enhancements */
.sidebar {
    background: #ffffff;
    min-height: 100vh;
    border-right: 1px solid #e9ecef;
}

.sidebar .nav-link {
    color: #666;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #de6e09;
    color: white;
}

/* Admin Cards */
.bg-primary {
    background-color: #de6e09 !important;
}

.card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    background: #ffffff;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pop-up Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-container {
    position: relative;
    max-width: 600px;
    max-height: 90vh;
    margin: 20px;
    animation: slideIn 0.4s ease;
}

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

.popup-image {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: block;
}

.popup-link {
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.popup-link:hover .popup-image {
    transform: scale(1.02);
}

.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10000;
    color: #333;
    font-size: 20px;
}

.popup-close:hover {
    background-color: #de6e09;
    color: #fff;
    transform: rotate(90deg);
}

/* Responsive Pop-up */
@media (max-width: 768px) {
    .popup-container {
        max-width: 90%;
        margin: 10px;
    }
    
    .popup-close {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .share-buttons,
    .popup-overlay {
        display: none !important;
    }

    .article-detail {
        box-shadow: none;
        padding: 0;
    }

    .article-content {
        font-size: 12pt;
    }
}
