/*!
 * PolGuard WPBakery Elements Styles
 * Custom styles for PolGuard WPBakery Page Builder elements
 *
 * @package PolGuard
 * @since 1.1.0
 */

/* ==========================================================================
   Base WPBakery Compatibility
   ========================================================================== */

/* Remove default margins and paddings from WPBakery */
.wpb_content_element {
    margin-bottom: 0 !important;
}

.vc_row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.vc_row[data-vc-full-width="true"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.vc_column_container {
    padding-left: 15px;
    padding-right: 15px;
}

/* ==========================================================================
   PolGuard Hero Section Element
   ========================================================================== */

.polguard-hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #eff6ff 100%);
    overflow: hidden;
}

.polguard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(71, 85, 105, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(71, 85, 105, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.polguard-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.polguard-hero p {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
}

.polguard-hero .hero-cta {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #334155, #1e40af);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(51, 65, 85, 0.2);
}

.polguard-hero .hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px rgba(51, 65, 85, 0.3);
    color: white;
}

.polguard-hero .hero-cta i {
    margin-right: 0.75rem;
    transition: transform 0.3s ease;
}

.polguard-hero .hero-cta:hover i {
    transform: rotate(15deg);
}

/* ==========================================================================
   PolGuard Service Card Element
   ========================================================================== */

.polguard-service-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(203, 213, 225, 0.3);
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.polguard-service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(71, 85, 105, 0.2);
}

.polguard-service-card .service-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.polguard-service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.polguard-service-card.style-primary .service-icon {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #334155;
}

.polguard-service-card.style-secondary .service-icon {
    background: linear-gradient(135deg, #f4f4f5, #e4e4e7);
    color: #3f3f46;
}

.polguard-service-card.style-accent .service-icon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.polguard-service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.polguard-service-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.polguard-service-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.polguard-service-card li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.polguard-service-card li i {
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.polguard-service-card.style-primary li i {
    color: #334155;
}

.polguard-service-card.style-secondary li i {
    color: #3f3f46;
}

.polguard-service-card.style-accent li i {
    color: #1d4ed8;
}

/* ==========================================================================
   PolGuard Contact Form Element
   ========================================================================== */

.polguard-contact-form {
    background: linear-gradient(135deg, #1f2937, #1e40af);
    position: relative;
    overflow: hidden;
}

.polguard-contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.polguard-contact-form h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.polguard-contact-form p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.polguard-contact-form .contact-info {
    margin-bottom: 2rem;
}

.polguard-contact-form .contact-info h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #f9fafb;
}

.polguard-contact-form .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.polguard-contact-form .contact-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.polguard-contact-form .contact-item i {
    margin-right: 1rem;
    font-size: 1.25rem;
    color: #93c5fd;
}

.polguard-contact-form .form-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    color: #1f2937;
}

.polguard-contact-form .form-container h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

/* ==========================================================================
   WPBakery Frontpage Contact Block (pg-*)
   ========================================================================== */

.pg-contact-title {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.pg-contact-title h2 {
    font-size: clamp(2.25rem, 4.5vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    color: #bfdbfe;
    margin: 0 0 1rem;
}

.pg-contact-title p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.5;
    color: #cbd5e1;
    margin: 0;
}

.pg-contact-info {
    color: #e2e8f0;
    padding-right: 1rem;
}

.pg-contact-info h3 {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1.5rem;
}

.pg-contact-item {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    margin-bottom: 1.15rem;
}

.pg-contact-item i {
    color: #cbd5e1;
    margin-top: 0.25rem;
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

.pg-contact-item .label {
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.pg-contact-item .value {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.45;
    margin-top: 0.15rem;
}

.pg-contact-availability {
    margin-top: 2rem;
}

.pg-contact-availability h3 {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem;
}

/* Use both selectors so current shortcode works even with class="row". */
.pg-contact-availability .pg-row,
.pg-contact-availability .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.7rem;
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.4;
}

.pg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    padding: 0.22rem 0.55rem;
    min-width: 2.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.pg-badge.gray {
    background: #334155;
    color: #e2e8f0;
}

.pg-badge.blue {
    background: #2563eb;
    color: #dbeafe;
}

.pg-badge.red {
    background: #ef4444;
    color: #fee2e2;
}

.pg-contact-wrap {
    width: 100%;
}

.pg-cf7-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    border: 0;
    box-shadow: none;
}

.pg-cf7-card h3 {
    color: #1e293b;
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 1.5rem;
}

.pg-cf7-form .wpcf7-form p {
    margin: 0 0 1rem;
}

.pg-cf7-form .wpcf7-form label {
    color: #334155;
    font-size: 1.05rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.45rem;
}

.pg-cf7-form .wpcf7-form-control-wrap {
    display: block;
    margin-top: 0.35rem;
}

.pg-cf7-form input[type="text"],
.pg-cf7-form input[type="email"],
.pg-cf7-form input[type="tel"],
.pg-cf7-form input[type="url"],
.pg-cf7-form select,
.pg-cf7-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 0.65rem;
    font-size: 1rem;
    line-height: 1.4;
    padding: 0.8rem 0.95rem;
}

.pg-cf7-form textarea {
    min-height: 130px;
    resize: vertical;
}

.pg-cf7-form input:focus,
.pg-cf7-form select:focus,
.pg-cf7-form textarea:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 0;
    border-color: #60a5fa;
}

.pg-cf7-form input[type="checkbox"] {
    margin-right: 0.5rem;
}

.pg-cf7-form .wpcf7-submit {
    width: 100%;
    border: 0;
    border-radius: 0.7rem;
    padding: 0.9rem 1.1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(90deg, #334155, #2563eb);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    cursor: pointer;
}

.pg-cf7-form .wpcf7-submit:hover {
    filter: brightness(1.05);
}

.pg-cf7-form .wpcf7-spinner {
    display: inline-block;
    margin-top: 0.65rem;
}

/* Ensure dark contact section background spans full viewport width
   even when WPBakery content is wrapped by a centered page container. */
.vc_row.vc_custom_contact,
.vc_row.vc_custom_contact2 {
    position: relative;
    z-index: 0;
    background: #0f172a !important;
    overflow: visible !important;
    box-shadow: 0 0 0 100vmax #0f172a;
    clip-path: inset(0 -100vmax);
}

.vc_row.vc_custom_contact::before,
.vc_row.vc_custom_contact2::before {
    content: none;
}

.vc_row.vc_custom_contact > .vc_column_container,
.vc_row.vc_custom_contact2 > .vc_column_container {
    position: relative;
    z-index: 1;
}

/* Keep content width like original layout (max-w-7xl style),
   while backgrounds can still stretch full viewport width. */
.vc_row.vc_custom_about,
.vc_row.vc_custom_contact,
.vc_row.vc_custom_contact2 {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100% !important;
    max-width: 1200px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box;
}

.vc_row.vc_custom_about .vc_column_container,
.vc_row.vc_custom_contact .vc_column_container,
.vc_row.vc_custom_contact2 .vc_column_container {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* Match vertical rhythm with original mockup */
.vc_row.vc_custom_about {
    padding-top: 80px !important;
    padding-bottom: 56px !important;
}

.vc_row.vc_custom_contact {
    padding-top: 56px !important;
    padding-bottom: 24px !important;
}

.vc_row.vc_custom_contact2 {
    margin-top: -1px !important;
    padding-top: 1px !important;
    padding-bottom: 72px !important;
}

/* ==========================================================================
   PolGuard Stats Counter Element
   ========================================================================== */

.polguard-stats {
    padding: 3rem 0;
}

.polguard-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.polguard-stats .stat-item {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 2rem 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.polguard-stats .stat-item:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-5px);
}

.polguard-stats .stat-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #334155;
}

.polguard-stats .stat-item h4 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.polguard-stats .stat-item p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* ==========================================================================
   PolGuard News Grid Element
   ========================================================================== */

.polguard-news-grid {
    padding: 2rem 0;
}

.polguard-news-grid .news-item {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.polguard-news-grid .news-item:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.polguard-news-grid .news-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

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

.polguard-news-grid .news-item:hover .news-image img {
    transform: scale(1.05);
}

.polguard-news-grid .news-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.polguard-news-grid .news-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.polguard-news-grid .news-meta i {
    margin-right: 0.25rem;
}

.polguard-news-grid .news-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.polguard-news-grid .news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.polguard-news-grid .news-title a:hover {
    color: #2563eb;
}

.polguard-news-grid .news-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
}

.polguard-news-grid .news-footer {
    display: flex;
    align-items: center;
    justify-between;
    margin-top: auto;
}

.polguard-news-grid .read-more {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.polguard-news-grid .read-more:hover {
    color: #1d4ed8;
}

.polguard-news-grid .read-more i {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.polguard-news-grid .read-more:hover i {
    transform: translateX(3px);
}

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

@media (max-width: 1024px) {
    .polguard-hero {
        min-height: 500px;
    }
    
    .polguard-hero h1 {
        font-size: 2.5rem;
    }
    
    .polguard-service-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .polguard-hero {
        min-height: 400px;
        padding: 2rem 1rem;
    }
    
    .polguard-hero h1 {
        font-size: 2rem;
    }
    
    .polguard-hero p {
        font-size: 1rem;
    }
    
    .polguard-service-card {
        padding: 1.5rem;
    }
    
    .polguard-contact-form .form-container {
        padding: 1.5rem;
    }
    
    .polguard-stats .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .polguard-stats .stat-item {
        padding: 1.5rem 1rem;
    }

    .pg-contact-info {
        padding-right: 0;
        margin-bottom: 1.75rem;
    }

    .pg-contact-title h2 {
        font-size: clamp(2rem, 9vw, 2.8rem);
    }

    .pg-contact-title p {
        font-size: 1.1rem;
    }

    .pg-contact-info h3,
    .pg-contact-availability h3 {
        font-size: 1.25rem;
    }

    .pg-cf7-card {
        padding: 1.35rem;
    }

    .pg-cf7-card h3 {
        font-size: 1.5rem;
    }

    .vc_row.vc_custom_about,
    .vc_row.vc_custom_contact,
    .vc_row.vc_custom_contact2 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .vc_row.vc_custom_about .vc_column_container,
    .vc_row.vc_custom_contact .vc_column_container,
    .vc_row.vc_custom_contact2 .vc_column_container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 480px) {
    .polguard-stats .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

@media print {
    .polguard-contact-form,
    .polguard-stats {
        display: none;
    }
    
    .polguard-hero {
        background: white !important;
        color: black !important;
        min-height: auto;
    }
    
    .polguard-service-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .polguard-service-card {
        background: rgba(31, 41, 55, 0.9);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .polguard-service-card h3 {
        color: #f9fafb;
    }
    
    .polguard-service-card p,
    .polguard-service-card li {
        color: #d1d5db;
    }
    
    .polguard-news-grid .news-item {
        background: rgba(31, 41, 55, 0.9);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .polguard-news-grid .news-title {
        color: #f9fafb;
    }
    
    .polguard-news-grid .news-excerpt {
        color: #d1d5db;
    }
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

@keyframes polguard-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes polguard-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.polguard-animate-fade-in {
    animation: polguard-fade-in-up 0.6s ease-out;
}

.polguard-animate-float {
    animation: polguard-float 3s ease-in-out infinite;
}

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

.polguard-hero .hero-cta:focus,
.polguard-news-grid .read-more:focus,
.polguard-service-card:focus-within {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .polguard-service-card,
    .polguard-news-grid .news-item,
    .polguard-stats .stat-item,
    .polguard-hero .hero-cta {
        transition: none;
    }
    
    .polguard-animate-fade-in,
    .polguard-animate-float {
        animation: none;
    }
}
