/**
 * Service Grid Widget Styles
 *
 * @package Netrobit_Core
 * @since 1.0.0
 */

/* Reset Elementor container padding and margin */
.elementor-widget-netrobit-service-grid {
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-netrobit-service-grid .elementor-widget-container {
    padding: 0 !important;
    margin: 0 !important;
}

/* Grid Container */
.netrobit-service-grid-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

.netrobit-service-grid {
    display: grid;
    /* Columns and gaps handled by Elementor settings */
    width: 100% !important;
    max-width: 100% !important;
}

/* Service Card */
.netrobit-service-item {
    position: relative;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--netrodent-transition-base, all 0.3s ease);
    width: 100%;
}

.netrobit-service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Background Image */
.netrobit-service-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.netrobit-service-item:hover .netrobit-service-image {
    transform: scale(1.05);
}

/* Dark Overlay */
.netrobit-service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--netrodent-shadow-light, rgba(0, 0, 0, 0.1)) 0%, rgba(0, 0, 0, 0.75) 100%);
    opacity: .75;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.netrobit-service-item:hover .netrobit-service-overlay {
    opacity: 1;
}

/* Content */
.netrobit-service-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

/* Icon */
.netrobit-service-icon {
    background-color: var(--netrodent-primary-color, #0073aa);
    border-radius: 10px;
    padding: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--netrodent-white, #ffffff);
    font-size: 28px;
    transition: transform 0.3s ease;
    width: auto;
    height: auto;
}

.netrobit-service-item:hover .netrobit-service-icon {
    transform: scale(1.1);
}

.netrobit-service-icon i,
.netrobit-service-icon svg {
    display: block;
    fill: currentColor;
}

/* Icon Image */
.netrobit-service-icon-image {
    background-color: transparent;
    padding: 0;
}

.netrobit-service-icon-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

/* Title */
.netrobit-service-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--netrodent-white, #ffffff);
    margin: 0 0 15px 0;
    line-height: 1.3;
    transition: transform 0.3s ease;
}

.netrobit-service-item:hover .netrobit-service-title {
    transform: translateX(5px);
}

/* Button */
.netrobit-service-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--netrodent-white, #ffffff);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--netrodent-transition-base, all 0.3s ease);
    cursor: pointer;
}

.netrobit-service-button:hover {
    gap: 12px;
}

.netrobit-service-button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.netrobit-service-item:hover .netrobit-service-button i {
    transform: translateX(5px);
}

/* Responsive */
/* Responsive limits specific to card height/padding handled below. 
   Grid columns are handled by Elementor responsive controls. */

@media (max-width: 992px) {
    /* Grid columns handled by Elementor */

    .netrobit-service-item {
        height: 300px;
    }

    .netrobit-service-content {
        padding: 25px;
    }

    .netrobit-service-icon {
        font-size: 24px;
        padding: 12px;
    }

    .netrobit-service-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    /* Grid columns handled by Elementor */

    .netrobit-service-item {
        height: 250px;
    }

    .netrobit-service-content {
        padding: 20px;
    }

    .netrobit-service-icon {
        font-size: 22px;
        padding: 10px;
        margin-bottom: 15px;
    }

    .netrobit-service-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .netrobit-service-button {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Grid columns handled by Elementor */

    .netrobit-service-item {
        height: 280px;
    }

    .netrobit-service-content {
        padding: 25px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.netrobit-service-item {
    animation: fadeInUp 0.5s ease;
}

.netrobit-service-item:nth-child(1) {
    animation-delay: 0s;
}

.netrobit-service-item:nth-child(2) {
    animation-delay: 0.1s;
}

.netrobit-service-item:nth-child(3) {
    animation-delay: 0.2s;
}

.netrobit-service-item:nth-child(4) {
    animation-delay: 0.3s;
}

.netrobit-service-item:nth-child(5) {
    animation-delay: 0.4s;
}

.netrobit-service-item:nth-child(6) {
    animation-delay: 0.5s;
}

.netrobit-service-item:nth-child(7) {
    animation-delay: 0.6s;
}

.netrobit-service-item:nth-child(8) {
    animation-delay: 0.7s;
}

/* ============================================
   Card Layout Style
   ============================================ */

/* Card Layout - Override default image styles */
.layout-card .netrobit-service-item {
    background-color: var(--netrodent-white, #ffffff);
    border: 1px solid var(--netrodent-border-color, #e0e0e0);
    height: auto;
    min-height: auto;
    transition: all var(--netrodent-transition-base, 0.3s ease);
}

.layout-card .netrobit-service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Card Content Layout */
.layout-card .netrobit-service-content {
    position: static;
    padding: 30px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Card Icon */
.layout-card .netrobit-service-icon {
    background-color: var(--netrodent-primary-color, #0073aa);
    border-radius: 12px;
    padding: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
    transition: all var(--netrodent-transition-base, 0.3s ease);
    width: auto;
    height: auto;
}

.layout-card .netrobit-service-item:hover .netrobit-service-icon {
    transform: scale(1.05);
    background-color: var(--netrodent-primary-dark, #005a87);
}

.layout-card .netrobit-service-icon i,
.layout-card .netrobit-service-icon svg {
    color: var(--netrodent-white, #ffffff);
    fill: currentColor;
    display: block;
}

/* Card Icon Image */
.layout-card .netrobit-service-icon-image {
    background-color: transparent;
    padding: 0;
}

.layout-card .netrobit-service-icon-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.layout-card .netrobit-service-item:hover .netrobit-service-icon-image {
    background-color: transparent;
}

/* Card Title */
.layout-card .netrobit-service-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--netrodent-text-dark, #1a1a1a);
    margin: 0 0 15px 0;
    line-height: 1.4;
    transition: color var(--netrodent-transition-base, 0.3s ease);
}

.layout-card .netrobit-service-item:hover .netrobit-service-title {
    color: var(--netrodent-primary-color, #0073aa);
    transform: none;
}

/* Card Description */
.netrobit-service-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--netrodent-text-light, #666666);
    margin: 0 0 20px 0;
}

/* Card Button/Link */
.layout-card .netrobit-service-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--netrodent-primary-color, #0073aa);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--netrodent-transition-base, 0.3s ease);
    cursor: pointer;
    margin-top: auto;
}

.layout-card .netrobit-service-button:hover {
    color: var(--netrodent-primary-dark, #005a87);
    gap: 12px;
}

.layout-card .netrobit-service-button i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.layout-card .netrobit-service-item:hover .netrobit-service-button i {
    transform: translateX(3px);
}

/* Card Layout - Responsive */
@media (max-width: 992px) {
    .layout-card .netrobit-service-content {
        padding: 25px;
    }

    .layout-card .netrobit-service-icon {
        font-size: 24px;
        padding: 12px;
    }

    .layout-card .netrobit-service-title {
        font-size: 20px;
    }

    .netrobit-service-description {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .layout-card .netrobit-service-content {
        padding: 20px;
    }

    .layout-card .netrobit-service-icon {
        font-size: 22px;
        padding: 10px;
        margin-bottom: 15px;
    }

    .layout-card .netrobit-service-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .netrobit-service-description {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .layout-card .netrobit-service-button {
        font-size: 14px;
    }
}