/* Additional custom styles for Delta Theme */

/* Preloader Fallback - Auto-hide after 5 seconds */
.loading-preloader {
    animation: autoHidePreloader 5s forwards;
}

@keyframes autoHidePreloader {
    0%, 80% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Advanced CSS Variables for Better Theming */
:root {
    --primary-color: #007cba;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --light-bg: #f8f9fa;
    --header-height: 80px;
    --footer-height: auto;
    --container-padding: 20px;
    --section-padding: 60px 0;
}

/* Utility classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

/* Enhanced Typography */
body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

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

/* Navigation Enhancements */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    position: relative;
    padding: 10px 16px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Mobile Navigation */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Footer Enhancements */
.site-footer {
    background: linear-gradient(135deg, var(--dark-color), #2c3e50);
    color: white;
    padding: var(--section-padding);
    margin-top: auto;
}

.footer-widget h5 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 0.5rem;
}

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-widget ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Content Area Improvements */
.main-content {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    padding: 40px 0;
}

.content-wrapper {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
    margin-bottom: 30px;
}

/* Post Navigation */
.post-navigation {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 3rem 0;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-previous,
.nav-next {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    padding: 1rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-previous:hover,
.nav-next:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.nav-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* Comments Styles */
.comments-area {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
}

.comment-list {
    padding-left: 0;
}

.comment-body {
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.comment-body:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.comment-author-avatar img {
    border: 2px solid var(--border-color);
}

.comment-awaiting-moderation {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.comment-form {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
}

.comment-form .form-label {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-form .required {
    font-size: 0.875rem;
}

/* No Results Styles */
.no-results {
    text-align: center;
    padding: 3rem 0;
}

.no-results .page-title {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.no-results .page-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Archive Styles */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 2rem;
}

.page-header .page-title {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.archive-description {
    font-size: 1.1rem;
    opacity: 0.9;
}

.posts-grid .card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.posts-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.posts-grid .card-img-top {
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    height: 200px;
}

.posts-grid .card-img-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.posts-grid .card:hover .card-img-top img {
    transform: scale(1.05);
}

/* Sidebar Styles */
.sidebar-widgets .widget {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.sidebar-widgets .widget-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-widgets .widget ul {
    list-style: none;
    padding: 0;
}

.sidebar-widgets .widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-widgets .widget ul li:last-child {
    border-bottom: none;
}

.sidebar-widgets .widget ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-widgets .widget ul li a:hover {
    color: var(--primary-color);
}

/* Search Form Styles */
.search-form {
    max-width: 400px;
    margin: 1rem auto;
}

.search-form .form-control {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
}

.search-form .btn {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: none;
}

/* Custom components */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #006ba1;
    border-color: #005a8b;
}

/* Hero section */
.hero-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color), #005a8b);
    color: white;
    text-align: center;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Back to top button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: none;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#back-to-top:hover {
    background: #006ba1;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

#back-to-top i {
    font-size: 18px;
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Blog post cards */
.post-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.post-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(0,0,0,0.5));
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: var(--transition);
}

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

.post-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form enhancements */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Breadcrumbs */
.breadcrumb-wrapper {
    background: var(--light-color);
    padding: 15px 0;
    margin-bottom: 30px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--dark-color);
    font-weight: 500;
}

/* Social sharing buttons */
.social-share {
    margin: 30px 0;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.social-share-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.social-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    color: white;
}

.social-btn:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.social-btn-facebook { background: #3b5998; }
.social-btn-twitter { background: #1da1f2; }
.social-btn-linkedin { background: #0077b5; }
.social-btn-pinterest { background: #bd081c; }

.social-btn-facebook:hover { background: #2d4373; }
.social-btn-twitter:hover { background: #1a91da; }
.social-btn-linkedin:hover { background: #005582; }
.social-btn-pinterest:hover { background: #8c0615; }

/* Accessibility Improvements */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Responsive typography */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .page-header .page-title {
        font-size: 2rem;
    }
    
    .posts-grid .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .comment-form {
        padding: 1rem;
    }
    
    .sidebar-widgets {
        margin-top: 2rem;
    }
}
