/**
 * TeknoWeb Multi Category Widget - Frontend Styles
 * 
 * @package TeknoWebElementorWidget
 * @since 1.0.0
 */

/* ===============================
   Base Styles
   =============================== */

.teknoweb-widget-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.teknoweb-widget-wrapper *,
.teknoweb-widget-wrapper *:before,
.teknoweb-widget-wrapper *:after {
    box-sizing: border-box;
}

.teknoweb-category-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ===============================
   Category Card Styles
   =============================== */

.teknoweb-category-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 300px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    will-change: transform;
}

.teknoweb-category-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ===============================
   Background Image
   =============================== */

.teknoweb-category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ===============================
   Overlay
   =============================== */

.teknoweb-category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

/* ===============================
   Content Wrapper
   =============================== */

.teknoweb-category-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 30px;
    color: #ffffff;
}

.teknoweb-content-wrapper {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.teknoweb-text-content {
    flex: 1;
    min-width: 200px;
}

/* ===============================
   Typography
   =============================== */

.teknoweb-category-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    transition: all 0.3s ease;
}

.teknoweb-category-description {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
    color: inherit;
    transition: all 0.3s ease;
}

/* ===============================
   Button Styles
   =============================== */

.teknoweb-button-wrapper {
    flex-shrink: 0;
}

.teknoweb-category-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 24px;
    background-color: #007cba;
    color: #ffffff;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.teknoweb-category-button:hover {
    background-color: #005a87;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
}

.teknoweb-category-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.teknoweb-category-button:active {
    transform: translateY(0);
}

/* Button Icons */
.teknoweb-category-button .icon-before {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}

.teknoweb-category-button .icon-after {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
}

.teknoweb-category-button i,
.teknoweb-category-button svg {
    font-size: inherit;
    transition: transform 0.3s ease;
}

.teknoweb-category-button:hover i,
.teknoweb-category-button:hover svg {
    transform: translateX(3px);
}

/* ===============================
   Hover Animations
   =============================== */

/* Zoom Animation */
.teknoweb-widget-wrapper[data-animation="zoom"] .teknoweb-category-card:hover {
    transform: scale(1.03);
}

.teknoweb-widget-wrapper[data-animation="zoom"] .teknoweb-category-card:hover .teknoweb-category-image {
    transform: scale(1.1);
}

/* Slide Up Animation */
.teknoweb-widget-wrapper[data-animation="slide-up"] .teknoweb-category-card:hover {
    transform: translateY(-10px);
}

.teknoweb-widget-wrapper[data-animation="slide-up"] .teknoweb-category-card:hover .teknoweb-category-image {
    transform: scale(1.05);
}

/* Slide Down Animation */
.teknoweb-widget-wrapper[data-animation="slide-down"] .teknoweb-category-card:hover {
    transform: translateY(10px);
}

.teknoweb-widget-wrapper[data-animation="slide-down"] .teknoweb-category-card:hover .teknoweb-category-image {
    transform: scale(1.05);
}

/* Rotate Animation */
.teknoweb-widget-wrapper[data-animation="rotate"] .teknoweb-category-card:hover {
    transform: rotate(1deg) scale(1.02);
}

.teknoweb-widget-wrapper[data-animation="rotate"] .teknoweb-category-card:hover .teknoweb-category-image {
    transform: rotate(-1deg) scale(1.05);
}

/* Fade In Animation */
.teknoweb-widget-wrapper[data-animation="fadeIn"] .teknoweb-category-card {
    opacity: 0.8;
}

.teknoweb-widget-wrapper[data-animation="fadeIn"] .teknoweb-category-card:hover {
    opacity: 1;
    transform: scale(1.02);
}

/* ===============================
   Lazy Loading
   =============================== */

.teknoweb-category-image.lazy-load {
    background-image: none !important;
    background-color: #f5f5f5;
    position: relative;
}

.teknoweb-category-image.lazy-load::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: teknoweb-spin 1s linear infinite;
}

.teknoweb-category-image.lazy-loaded {
    transition: opacity 0.5s ease;
}

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

/* ===============================
   Responsive Design
   =============================== */

/* Tablet Styles */
@media (max-width: 1024px) {
    .teknoweb-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .teknoweb-category-title {
        font-size: 22px;
    }
    
    .teknoweb-category-description {
        font-size: 15px;
    }
    
    .teknoweb-category-content {
        padding: 25px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .teknoweb-category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .teknoweb-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .teknoweb-text-content {
        width: 100%;
    }
    
    .teknoweb-button-wrapper {
        width: 100%;
    }
    
    .teknoweb-category-button {
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .teknoweb-category-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .teknoweb-category-description {
        font-size: 14px;
    }
    
    .teknoweb-category-content {
        padding: 20px;
    }
    
    .teknoweb-category-card {
        min-height: 250px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .teknoweb-category-content {
        padding: 15px;
    }
    
    .teknoweb-category-title {
        font-size: 18px;
    }
    
    .teknoweb-category-description {
        font-size: 13px;
    }
    
    .teknoweb-category-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===============================
   RTL Support
   =============================== */

.teknoweb-widget-wrapper[dir="rtl"] .teknoweb-content-wrapper {
    direction: rtl;
}

.teknoweb-widget-wrapper[dir="rtl"] .teknoweb-category-button .icon-before {
    margin-right: 0;
    margin-left: 8px;
}

.teknoweb-widget-wrapper[dir="rtl"] .teknoweb-category-button .icon-after {
    margin-left: 0;
    margin-right: 8px;
}

.teknoweb-widget-wrapper[dir="rtl"] .teknoweb-category-button:hover i,
.teknoweb-widget-wrapper[dir="rtl"] .teknoweb-category-button:hover svg {
    transform: translateX(-3px);
}

/* ===============================
   Accessibility
   =============================== */

@media (prefers-reduced-motion: reduce) {
    .teknoweb-category-card,
    .teknoweb-category-image,
    .teknoweb-category-overlay,
    .teknoweb-category-button,
    .teknoweb-category-button i,
    .teknoweb-category-button svg {
        transition: none !important;
        animation: none !important;
    }
}

.teknoweb-category-card:focus-visible {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.teknoweb-category-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* ===============================
   Print Styles
   =============================== */

@media print {
    .teknoweb-category-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .teknoweb-category-overlay {
        display: none;
    }
    
    .teknoweb-category-image {
        filter: grayscale(100%);
    }
}

/* ===============================
   High Contrast Mode
   =============================== */

@media (prefers-contrast: high) {
    .teknoweb-category-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .teknoweb-category-button {
        border: 2px solid currentColor;
    }
}

/* ===============================
   Performance Optimizations
   =============================== */

.teknoweb-category-card {
    contain: layout style paint;
}

.teknoweb-category-image {
    contain: layout style paint;
    transform: translateZ(0);
}

.teknoweb-category-button {
    contain: layout style;
}