/* --- Features Section Styles --- */
.features-section {
    padding: clamp(60px, 10vw, 120px) 0;
    position: relative;
    background: #ffffff; 
    overflow: hidden;
    z-index: 1; /* Base for content */
}

.features-svg-bg {
    position: absolute;
    top: 5%; /* Starts slightly near the header */
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1; /* Stay behind the container and cards */
    opacity: 0.35; 
    display: flex;
    justify-content: center;
}

.features-svg-bg svg {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures it fills the background area */
    min-width: 1422px; 
}

.features-header {
    text-align: center;
    max-width: 100%; /* Changed from 1200px to allow full width alignment */
    margin: 0 auto 60px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 5;
    padding: 0 20px;
}

.features-badge {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    padding: clamp(6px, 1.2vw, 8px) clamp(12px, 2vw, 18px);
    border-radius: 999px;
    background-color: #f7f9f8;
    border: 1px solid #e3e6e5;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.features-badge i {
    width: clamp(25px, 4vw, 35px);
    height: clamp(25px, 4vw, 35px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.6rem, 1.2vw, 0.8rem);
    color: #1fa37a;
    background-color: #e6f5ef;
    border-radius: 50%;
}

.features-main-title {
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 20px;
    margin-bottom: 20px;
    white-space: nowrap; 
    width: fit-content; 
    max-width: 100%; 
}

@media (max-width: 600px) {
    .features-main-title {
        white-space: normal; 
    }
}

.features-description {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-sec);
    line-height: 1.7;
    max-width: 750px;
}

.features-grid {
    display: flex; 
    flex-wrap: wrap;
    justify-content: center; /* Centers the cards in rows */
    gap: 30px;
    margin-top: 40px;
    position: relative;
    z-index: 5;
    max-width: 1400px; /* Control max width to reduce large side margins */
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px; /* Reduced padding to fix the 'large margin' issue */
}

.feature-card {
    /* Adjusted flex to allow 4 cards in very large screens */
    flex: 0 1 calc(25% - 30px); 
    min-width: 280px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.5);
    padding: 35px 25px;
    border-radius: 20px;
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 5;
}

@property --border-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0turn;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(20, 229, 209, 0.15);
    border-color: transparent;
    --main-bg: conic-gradient(from var(--border-angle), #ffffff, #f9fdfc 5%, #f9fdfc 60%, #ffffff 95%);
    --gradient-border: conic-gradient(from var(--border-angle), transparent 25%, var(--primary-cyan), var(--dark-teal) 99%, transparent);
    background: 
        var(--main-bg) padding-box, 
        var(--gradient-border) border-box, 
        var(--main-bg) border-box;

    animation: border-spin 2s linear infinite;
}

@keyframes border-spin {
    to { --border-angle: 1turn; }
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-cyan), #e6f5ef);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.feature-text {
    font-size: 0.95rem;
    color: var(--text-sec);
    line-height: 1.6;
}

@media (max-width: 1300px) {
    .feature-card {
        flex: 0 1 calc(33.333% - 30px); /* 3 cards per row */
    }
}

@media (max-width: 992px) {
    .feature-card {
        flex: 0 1 calc(50% - 30px); /* 2 cards per row */
    }
}

@media (max-width: 768px) {
    .features-grid {
        padding: 0 20px;
    }
    
    .feature-card {
        flex: 1 1 100%; /* Full width on mobile */
        padding: 25px 20px;
    }

    .features-svg-bg {
        opacity: 0.15;
        top: 20%;
    }
}