/**
 * Adrin Widgets CSS
 * Premium styling for Elementor widgets
 * Author: Farid Honarvar
 */

/* ============================================
   GLOBAL STYLES
============================================ */
.adrin-widgets * {
    box-sizing: border-box;
}

/* ============================================
   HERO SLIDER WIDGET
============================================ */
.adrin-hero-slider-wrapper {
    position: relative;
    width: 100%;
}

.adrin-hero-slider {
    position: relative;
    width: 100%;
    height: 650px;
    overflow: hidden;
    display: flex;
    align-items: center;
    background-color: #111827;
}

.adrin-hero-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.adrin-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.adrin-hero-slide.active {
    opacity: 0.6;
    z-index: 2;
}

.adrin-hero-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adrin-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 3;
}

.adrin-hero-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    z-index: 4;
}

.adrin-hero-content-inner {
    max-width: 48rem;
}

/* Badge (تاسیس و سال تجربه) */
.adrin-hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(234, 179, 8, 0.5);
    border-radius: 9999px;
    color: #EAB308;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    background-color: rgba(234, 179, 8, 0.1);
    backdrop-filter: blur(10px);
}

.adrin-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.adrin-hero-title-gradient {
    background: linear-gradient(90deg, #EF4444 0%, #EAB308 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.adrin-hero-description {
    font-size: 1.25rem;
    line-height: 1.75;
    margin-bottom: 0;
    color: #D1D5DB;
    max-width: 42rem;
}

/* Buttons Container - چسبیده به پایین Hero */
.adrin-hero-buttons-container {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    z-index: 5;
    padding: 0 2rem;
}

.adrin-hero-buttons {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.adrin-hero-buttons.icon-left .adrin-hero-btn {
    flex-direction: row-reverse;
}

.adrin-hero-buttons.icon-right .adrin-hero-btn {
    flex-direction: row;
}

.adrin-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.adrin-hero-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.adrin-hero-btn-primary {
    background-color: #B91C1C;
    color: #ffffff;
}

.adrin-hero-btn-primary:hover {
    background-color: #991B1B;
}

.adrin-hero-btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.adrin-hero-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.adrin-hero-btn-tertiary {
    background-color: #D4AF37;
    color: #1F2937;
}

.adrin-hero-btn-tertiary:hover {
    background-color: #C19B2A;
}

/* Stats Bar - جدا از Hero در زیر آن */
.adrin-stats-bar-separate {
    width: 100%;
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border-top: 2px solid #374151;
}

.adrin-stats-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .adrin-stats-bar-inner {
        grid-template-columns: repeat(4, 1fr);
        padding: 2.5rem 2rem;
    }
}

.adrin-stats-bar-separate .adrin-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
    padding: 0;
}

.adrin-stats-bar-separate .adrin-stat-icon {
    font-size: 2rem;
    color: #EAB308;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .adrin-stats-bar-separate .adrin-stat-icon {
        font-size: 2.5rem;
    }
}

.adrin-stats-bar-separate .adrin-stat-icon svg {
    width: 2rem;
    height: 2rem;
}

@media (min-width: 768px) {
    .adrin-stats-bar-separate .adrin-stat-icon svg {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.adrin-stats-bar-separate .adrin-stat-content {
    display: flex;
    flex-direction: column;
}

.adrin-stats-bar-separate .adrin-stat-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .adrin-stats-bar-separate .adrin-stat-number {
        font-size: 2rem;
    }
}

.adrin-stats-bar-separate .adrin-stat-text {
    font-size: 0.75rem;
    color: #9CA3AF;
}

@media (min-width: 768px) {
    .adrin-stats-bar-separate .adrin-stat-text {
        font-size: 0.875rem;
    }
}

/* ============================================
   PRODUCT CATEGORIES WIDGET
============================================ */
.adrin-products-wrapper {
    padding: 3rem 0;
}

.adrin-products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #F3F4F6;
}

.adrin-products-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1F2937;
    margin: 0;
    border-right: 4px solid #B91C1C;
    padding-right: 1rem;
}

.adrin-view-all {
    display: none;
}

@media (min-width: 768px) {
    .adrin-view-all {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        color: #B91C1C;
        text-decoration: none;
        font-weight: 700;
        transition: gap 0.3s ease;
    }

    .adrin-view-all:hover {
        gap: 0.75rem;
    }
}

.adrin-view-all svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.adrin-products-grid {
    display: grid;
    gap: 1rem;
}

.adrin-product-card {
    display: block;
    background-color: #F9FAFB;
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.adrin-product-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.adrin-category-image {
    height: 128px;
    overflow: hidden;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F9FAFB;
}

.adrin-category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.adrin-product-card:hover .adrin-category-image img {
    transform: scale(1.1);
}

.adrin-category-title {
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1F2937;
    text-align: center;
    margin: 0;
    background-color: #ffffff;
    transition: color 0.3s ease;
}

.adrin-product-card:hover .adrin-category-title {
    color: #B91C1C;
}

/* ============================================
   EXPORT MAP WIDGET
============================================ */
.adrin-map-wrapper {
    padding: 3rem 0;
}

.adrin-map-header {
    text-align: center;
    margin-bottom: 3rem;
}

.adrin-map-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1F2937;
    margin-bottom: 1rem;
}

.adrin-map-description {
    font-size: 1.125rem;
    color: #6B7280;
    max-width: 600px;
    margin: 0 auto;
}

.adrin-map-container {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #1F2937;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid #374151;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.adrin-map-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.3;
    filter: grayscale(100%) invert(1);
    pointer-events: none;
}

.adrin-map-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.adrin-map-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.adrin-map-marker.export {
    background-color: #DC2626;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

.adrin-map-marker.production {
    background-color: #D4AF37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.adrin-map-marker::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: inherit;
    opacity: 0.5;
    animation: adrin-pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes adrin-pulse-ring {
    0% {
        transform: scale(0.33);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.adrin-map-marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 30;
}

.adrin-map-marker:hover::before {
    animation: none;
}

.adrin-map-tooltip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #ffffff;
    color: #000000;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 20;
}

.adrin-map-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.adrin-map-marker:hover .adrin-map-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Map Legend (راهنما) */
.adrin-map-legend {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 15;
}

.adrin-map-legend-top-left {
    top: 1rem;
    left: 1rem;
}

.adrin-map-legend-top-right {
    top: 1rem;
    right: 1rem;
}

.adrin-map-legend-bottom-left {
    bottom: 1rem;
    left: 1rem;
}

.adrin-map-legend-bottom-right {
    bottom: 1rem;
    right: 1rem;
}

.adrin-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.adrin-legend-item:last-child {
    margin-bottom: 0;
}

.adrin-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.adrin-legend-dot.production {
    background-color: #D4AF37;
}

.adrin-legend-dot.export {
    background-color: #DC2626;
}

.adrin-legend-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1F2937;
    white-space: nowrap;
}

/* ============================================
   LATEST NEWS WIDGET
============================================ */
.adrin-news-wrapper {
    padding: 3rem 0;
}

.adrin-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.adrin-news-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1F2937;
    margin: 0;
}

.adrin-archive-link {
    font-size: 0.875rem;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.adrin-archive-link:hover {
    color: #DC2626;
}

.adrin-news-grid {
    display: grid;
    gap: 2rem;
}

.adrin-news-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.adrin-news-image-link {
    display: block;
    overflow: hidden;
    border-radius: 0.75rem;
}

.adrin-news-image {
    width: 100%;
    overflow: hidden;
    background-color: #E5E7EB;
    position: relative;
}

.adrin-news-image.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.adrin-news-image.ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.adrin-news-image.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.adrin-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.adrin-news-card:hover .adrin-news-image img {
    transform: scale(1.08);
}

.adrin-news-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.adrin-news-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: #DC2626;
}

.adrin-news-post-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
}

.adrin-news-post-title a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.3s ease;
}

.adrin-news-post-title a:hover {
    color: #DC2626;
}

.adrin-news-excerpt {
    font-size: 0.875rem;
    line-height: 1.75;
    color: #6B7280;
    margin: 0;
}

/* ============================================
   RESPONSIVE STYLES
============================================ */
@media (max-width: 1024px) {
    .adrin-hero-title {
        font-size: 2.5rem;
    }
    
    .adrin-hero-description {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .adrin-hero-slider {
        height: 500px;
    }
    
    .adrin-hero-title {
        font-size: 2rem;
    }
    
    .adrin-hero-description {
        font-size: 1rem;
    }
    
    .adrin-hero-buttons-container {
        bottom: 1rem;
        padding: 0 1rem;
    }
    
    .adrin-hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .adrin-hero-btn {
        width: 100%;
        justify-content: center;
    }
    
    .adrin-products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .adrin-map-container {
        height: 350px;
    }
    
    .adrin-map-image {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
    }
    
    .adrin-map-marker {
        width: 8px;
        height: 8px;
    }
    
    .adrin-map-marker::before {
        width: 16px;
        height: 16px;
        left: -4px;
        top: -4px;
    }
    
    .adrin-map-legend {
        padding: 0.625rem;
    }
    
    .adrin-legend-dot {
        width: 10px;
        height: 10px;
    }
    
    .adrin-legend-text {
        font-size: 0.625rem;
    }
    
    .adrin-news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .adrin-hero-content {
        padding: 0 1rem;
    }
    
    .adrin-hero-slider {
        height: 450px;
    }
    
    .adrin-hero-title {
        font-size: 1.75rem;
    }
    
    .adrin-hero-badge {
        font-size: 0.65rem;
        padding: 0.375rem 0.75rem;
    }
    
    .adrin-products-title {
        font-size: 1.5rem;
    }
    
    .adrin-map-container {
        height: 300px;
        border-radius: 0.75rem;
    }
    
    .adrin-map-legend {
        padding: 0.5rem;
        border-radius: 0.375rem;
    }
    
    .adrin-legend-text {
        font-size: 0.5rem;
    }
}

/* ============================================
   RTL SUPPORT
============================================ */
[dir="rtl"] .adrin-products-title {
    border-right: 4px solid #B91C1C;
    border-left: none;
    padding-right: 1rem;
    padding-left: 0;
}

[dir="rtl"] .adrin-view-all svg {
    transform: scaleX(-1);
}

[dir="rtl"] .adrin-view-all:hover svg {
    transform: scaleX(-1);
}
