/**
 * Palladium Mining Theme - Custom Styles
 * Additional styles and overrides
 */

/* ==================== Additional Animations ==================== */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* ==================== Hero Enhancements ==================== */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(transparent, rgba(255,255,255,0.1));
    pointer-events: none;
    z-index: 2;
}

.hero-title {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-slogan {
    position: relative;
    display: inline-block;
}

.hero-slogan::before,
.hero-slogan::after {
    content: '|';
    color: var(--secondary-color);
    margin: 0 15px;
    opacity: 0.7;
}

/* ==================== Card Hover Effects ==================== */
.service-card::before,
.solution-card::before,
.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before,
.solution-card:hover::before,
.portal-card:hover::before {
    transform: scaleX(1);
}

.service-card {
    position: relative;
    overflow: hidden;
}

/* ==================== Gradient Text ==================== */
.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Custom Scrollbar ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== Loading States ==================== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

/* ==================== Image Lazy Load ==================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* ==================== Blog Styles ==================== */
.blog-section {
    padding: 100px 0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition-fast);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--primary-color);
    color: var(--text-light);
}

.no-posts {
    text-align: center;
    padding: 80px 20px;
}

.no-posts h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ==================== Single Post ==================== */
.single-post-header {
    padding: 180px 0 100px;
    background: var(--gradient-primary);
    text-align: center;
}

.single-post-header h1 {
    color: var(--text-light);
    max-width: 900px;
    margin: 0 auto 20px;
}

.single-post-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: rgba(255,255,255,0.8);
}

.single-post-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.single-post-content {
    padding: 80px 0;
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.9;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content img {
    border-radius: var(--border-radius);
    margin: 30px 0;
}

.post-content ul,
.post-content ol {
    padding-right: 30px;
    margin-bottom: 20px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content blockquote {
    padding: 30px;
    background: var(--bg-light);
    border-right: 4px solid var(--secondary-color);
    margin: 30px 0;
    font-style: italic;
}

/* ==================== Page Templates ==================== */
.page-template-services .services-grid {
    grid-template-columns: repeat(2, 1fr);
}

.page-template-solutions .solutions-content.active {
    grid-template-columns: repeat(3, 1fr);
}

/* ==================== Archive Pages ==================== */
.archive-header {
    padding: 150px 0 80px;
    background: var(--gradient-primary);
    text-align: center;
}

.archive-header h1 {
    color: var(--text-light);
    margin-bottom: 15px;
}

.archive-header p {
    color: rgba(255,255,255,0.8);
    font-size: 1.125rem;
}

/* ==================== 404 Page ==================== */
.error-404 {
    padding: 150px 0;
    text-align: center;
}

.error-404 h1 {
    font-size: 8rem;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 20px;
}

.error-404 h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.error-404 p {
    font-size: 1.125rem;
    margin-bottom: 30px;
}

/* ==================== Search Results ==================== */
.search-results-header {
    padding: 150px 0 80px;
    background: var(--gradient-primary);
    text-align: center;
}

.search-results-header h1 {
    color: var(--text-light);
}

.search-results-header span {
    color: var(--secondary-color);
}

.search-form-inline {
    max-width: 600px;
    margin: 30px auto 0;
    display: flex;
    gap: 10px;
}

.search-form-inline input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

/* ==================== Comments ==================== */
.comments-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0;
    border-top: 1px solid var(--bg-gray);
}

.comments-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.comment {
    padding: 25px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.comment-author-name {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.comment-form {
    margin-top: 40px;
}

.comment-form h3 {
    font-size: 1.25rem;
    margin-bottom: 25px;
}

/* ==================== Sidebar ==================== */
.sidebar {
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.125rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color);
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-gray);
}

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

.widget ul li a {
    color: var(--text-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* ==================== Accessibility ==================== */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ==================== Print Styles ==================== */
@media print {
    .site-header,
    .site-footer,
    .scroll-to-top,
    .hero-section,
    .cta-section {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .post-content {
        max-width: 100%;
    }
}

/* ==================== RTL Specific Fixes ==================== */
[dir="rtl"] .hero-slogan::before {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .hero-slogan::after {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .post-content ul,
[dir="rtl"] .post-content ol {
    padding-right: 30px;
    padding-left: 0;
}

[dir="rtl"] .post-content blockquote {
    border-right: 4px solid var(--secondary-color);
    border-left: none;
}

/* ==================== WooCommerce Compatibility ==================== */
.woocommerce-page .site-main {
    padding-top: 150px;
}

.woocommerce .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.woocommerce .product {
    background: var(--text-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.woocommerce .product:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

/* ==================== Custom Admin Bar Adjustments ==================== */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* ==================== Additional Utility Classes ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mb-3 { margin-bottom: 30px !important; }
.mb-4 { margin-bottom: 40px !important; }
.mb-5 { margin-bottom: 50px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }
.mt-3 { margin-top: 30px !important; }
.mt-4 { margin-top: 40px !important; }
.mt-5 { margin-top: 50px !important; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

.hidden-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hidden-desktop {
        display: block !important;
    }
}

/* ==================== Mobile Sidebar Enhancements ==================== */

/* Decorative accent line on sidebar */
.mobile-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--secondary-color), transparent 80%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.mobile-sidebar.active::before {
    opacity: 1;
}

/* Menu item separator lines */
.mobile-nav-menu > li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Active menu item glow effect */
.mobile-nav-menu > li.current-menu-item > a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--secondary-color);
    border-radius: 3px 0 0 3px;
    box-shadow: 0 0 8px rgba(168, 178, 189, 0.5);
}

/* Smooth sidebar body fade edges */
.mobile-sidebar-body::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 20px;
    background: linear-gradient(transparent, rgba(13, 40, 64, 0.8));
    pointer-events: none;
}

/* Social hover specific colors */
.mobile-sidebar-social a[aria-label="LinkedIn"]:hover {
    background: #0077b5;
    border-color: #0077b5;
    color: #fff;
}

.mobile-sidebar-social a[aria-label="Twitter"]:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

.mobile-sidebar-social a[aria-label="Facebook"]:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.mobile-sidebar-social a[aria-label="Instagram"]:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: #dc2743;
    color: #fff;
}

.mobile-sidebar-social a[aria-label="WhatsApp"]:hover {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}

.mobile-sidebar-social a[aria-label="YouTube"]:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #fff;
}

/* Small screen adjustments */
@media (max-width: 380px) {
    .mobile-sidebar {
        width: 100vw;
        max-width: 100vw;
    }

    .mobile-nav-menu > li > a {
        padding: 13px 18px;
        font-size: 0.9rem;
    }

    .mobile-nav-menu .sub-menu li a {
        padding-right: 36px;
        padding-left: 18px;
    }

    .mobile-sidebar-contact .mobile-contact-item span {
        font-size: 0.78rem;
    }

    .mobile-sidebar-social a {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
    }
}
