/* DFA Insurance Website Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo,
.custom-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Ensure logo link behaves like inline block for layout */
.custom-logo-link,
.logo-link {
    display: inline-block;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.phone {
    color: #2c5aa0;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
}

.cta-button {
    background: #2c5aa0;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    background: #1e3d6f;
}

.cta-button.secondary {
    background: transparent;
    color: #2c5aa0;
    border: 2px solid #2c5aa0;
}

.cta-button.secondary:hover {
    background: #2c5aa0;
    color: white;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5vh auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

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

.modal-header {
    background: #2c5aa0;
    color: white;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 30px;
}

.service-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.service-option {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    background: white;
}

.service-option:hover {
    border-color: #2c5aa0;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 90, 160, 0.2);
}

.service-option .service-icon {
    font-size: 2rem;
    margin-right: 20px;
    color: #2c5aa0;
    min-width: 40px;
    text-align: center;
}

.service-option .service-text {
    flex: 1;
}

.service-option .service-text h4 {
    margin: 0 0 5px 0;
    color: #2c5aa0;
    font-size: 1.1rem;
}

.service-option .service-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.service-option .form-indicator {
    color: #2c5aa0;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.service-option:hover .form-indicator {
    opacity: 1;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

/* Gravity Forms Modal Styles */
.gravity-form-modal {
    max-width: 700px;
    width: 95%;
}

.form-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Gravity Forms Custom Styling */
.gform_wrapper {
    margin: 0;
}

.gform_wrapper .gfield {
    margin-bottom: 20px;
}

.gform_wrapper .gfield_label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.gform_wrapper .gfield_required {
    color: #e74c3c;
}

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper textarea,
.gform_wrapper select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper input[type="number"]:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select {
    border-color: #e74c3c;
}

.gform_wrapper .validation_message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

.gform_wrapper .gform_footer {
    margin-top: 30px;
    text-align: center;
}

.gform_wrapper .gform_button {
    background: #2c5aa0;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    min-width: 150px;
}

.gform_wrapper .gform_button:hover {
    background: #1e3d6f;
}

.gform_wrapper .gform_button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Form Success/Error Messages */
.gform_confirmation_message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
}

/* Global notification (used for post-submit confirmation) */
.dfa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: #1e3d6f;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 420px;
}
.dfa-notification.dfa-success { background: #155724; }
.dfa-notification.dfa-error { background: #721c24; }

.gform_wrapper .gform_validation_errors {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

/* Responsive Form Design */
@media (max-width: 768px) {
    .gravity-form-modal {
        width: 98%;
        margin: 5% auto;
    }
    
    .gform_wrapper input[type="text"],
    .gform_wrapper input[type="email"],
    .gform_wrapper input[type="tel"],
    .gform_wrapper input[type="number"],
    .gform_wrapper textarea,
    .gform_wrapper select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch; /* Change from 'center' to 'stretch' */
    position: relative;
    z-index: 2;
    min-height: 400px; /* Add minimum height */
}


.hero-logo-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    padding: 20px 0; /* Add padding to match stats spacing */
}

.hero-ctas {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center; /* Center stats vertically */
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Trust Signals */
.trust-signals {
    background: #f8f9fa;
    padding: 40px 0;
}

.trust-content {
    text-align: center;
}

.trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.trust-badge {
    padding: 10px 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-weight: bold;
    color: #666;
}

/* Services Section */
.services {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #2c5aa0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card .service-icon {
    width: 60px;
    height: 60px;
    background: #2c5aa0;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* Ensure inline SVG icons scale and inherit color */
.service-card .service-icon svg { width: 28px; height: 28px; display: block; }
.feature-icon svg { width: 24px; height: 24px; display: block; }

.service-card h3 {
    margin-bottom: 15px;
    color: #2c5aa0;
}

/* Why Choose Us */
.why-choose {
    background: #f8f9fa;
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: #2c5aa0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.feature-content h4 {
    margin-bottom: 10px;
    color: #2c5aa0;
}

/* CTA Section */
.cta-section {
    background: #2c5aa0;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Team page */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.team-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}
.team-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-avatar-placeholder { font-size: 48px; color: #9bb3d6; }
.team-name { margin: 8px 0 4px; color: #2c5aa0; }
.team-position { margin: 0 0 8px; font-weight: 600; color: #3a4a5e; }
.team-desc { font-size: 0.95rem; color: #4a596d; }

/* Footer */
footer {
    background: #1e3d6f;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 20px;
}

.footer-section h4 {
    margin-bottom: 20px;
    color: #b8d0f0;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-section ul li a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
    opacity: 0.8;
}

/* Footer menu (WP Nav Menu) layout */
.footer-menu .footer-menu-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 24px;
    padding: 0;
    margin: 0;
}
.footer-menu .footer-menu-list li {
    margin-bottom: 10px;
}

@media (max-width: 1024px) {
    .footer-menu .footer-menu-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .footer-menu .footer-menu-list {
        grid-template-columns: 1fr;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-logo-image {
        max-width: 90%;
        margin-bottom: 20px;
    }

    .hero-ctas {
        justify-content: center;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .trust-logos {
        gap: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 2vh auto;
        width: 95%;
        max-height: 96vh;
    }

    .service-option {
        flex-direction: column;
        text-align: center;
    }

    .service-option .service-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* YouTube Videos Page Styles */
.videos-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.videos-error {
    text-align: center;
    padding: 60px 20px;
}

.error-message {
    max-width: 500px;
    margin: 0 auto;
}

.error-message h3 {
    color: #d63638;
    margin-bottom: 15px;
}

.videos-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-message h3 {
    color: #666;
    margin-bottom: 15px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio for YouTube thumbnails */
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-item:hover .video-overlay {
    opacity: 1;
}

.play-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
}

.play-button svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #333;
}

.video-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Video Modal Styles */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.video-modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.video-modal-content {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Video Grid */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }
    
    .video-info {
        padding: 15px;
    }
    
    .video-title {
        font-size: 1rem;
    }
    
    .video-modal-overlay {
        padding: 10px;
    }
    
    .video-modal-close {
        top: -30px;
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
