/**
 * Frontend styles for Gutenberg blocks
 * Extends existing invoice-generator.css styles for landing page blocks
 */

/* Block containers that match the invoice generator UI */
.wp-block-group.sig-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wp-block-group.sig-section.has-background {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wp-block-group.sig-section.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Section headers matching invoice generator styling */
.sig-section .wp-block-heading {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.sig-section h2.wp-block-heading {
    font-size: 28px;
    color: #2c3e50;
}

.sig-section h3.wp-block-heading {
    font-size: 20px;
    color: #34495e;
}

/* List styling to match the invoice generator */
.sig-section .wp-block-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sig-section .wp-block-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sig-section .wp-block-list li:last-child {
    border-bottom: none;
}

.sig-section .wp-block-list li strong {
    color: #2c3e50;
    font-weight: 600;
    min-width: fit-content;
}

/* Add icons to list items */
.sig-section .wp-block-list li::before {
    content: "✓";
    color: #27ae60;
    font-weight: bold;
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Ordered list styling */
.sig-section ol.wp-block-list {
    counter-reset: step-counter;
}

.sig-section ol.wp-block-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 40px;
}

.sig-section ol.wp-block-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 12px;
    background: #3498db;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Button styling to match invoice generator */
.sig-section .wp-block-buttons {
    margin-top: 25px;
}

.sig-section .wp-block-button .wp-block-button__link {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.sig-section .wp-block-button .wp-block-button__link:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

/* Template grid layout (for template options block) */
.sig-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.sig-template-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sig-template-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.sig-template-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.sig-template-card p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
}

/* Feature showcase styling */
.sig-feature-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.sig-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sig-feature-icon {
    width: 40px;
    height: 40px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.sig-feature-content h5 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.sig-feature-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
}

/* CTA sections with enhanced styling */
.sig-section.has-background.sig-cta-section {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    text-align: center;
}

.sig-cta-section .wp-block-heading {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.sig-cta-section p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
}

.sig-cta-section .wp-block-button .wp-block-button__link {
    background: white;
    color: #2c3e50;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sig-cta-section .wp-block-button .wp-block-button__link:hover {
    background: #ecf0f1;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Resources section with external link styling */
.sig-resources-section .wp-block-list li a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.sig-resources-section .wp-block-list li a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

.sig-resources-section .wp-block-list li a::after {
    content: " ↗";
    font-size: 12px;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
    .sig-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .sig-section .wp-block-heading {
        font-size: 22px;
    }
    
    .sig-template-grid {
        grid-template-columns: 1fr;
    }
    
    .sig-feature-showcase {
        grid-template-columns: 1fr;
    }
    
    .sig-section .wp-block-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .sig-cta-section p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sig-section {
        padding: 15px;
    }
    
    .sig-section .wp-block-heading {
        font-size: 20px;
    }
    
    .sig-section .wp-block-button .wp-block-button__link {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .sig-section {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    .sig-section .wp-block-button {
        display: none;
    }
}

/* Callout Block Styles */
.sig-callout {
    display: flex;
    flex-direction: column;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sig-callout-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.sig-callout-icon {
    font-size: 24px;
    line-height: 1;
}

.sig-callout-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sig-callout-content p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.sig-callout-button {
    margin-top: 15px;
}

/* Callout type variations */
.sig-callout-info {
    background: #e8f4fd;
    border-left-color: #3498db;
    color: #2c3e50;
}

.sig-callout-info .sig-callout-title {
    color: #2980b9;
}

.sig-callout-success {
    background: #eafaf1;
    border-left-color: #27ae60;
    color: #1e3a2e;
}

.sig-callout-success .sig-callout-title {
    color: #229954;
}

.sig-callout-warning {
    background: #fef9e7;
    border-left-color: #f39c12;
    color: #3d2914;
}

.sig-callout-warning .sig-callout-title {
    color: #d68910;
}

.sig-callout-error {
    background: #fdeaea;
    border-left-color: #e74c3c;
    color: #3d1a1a;
}

.sig-callout-error .sig-callout-title {
    color: #c0392b;
}

/* Client Review Block Styles */
.sig-review {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sig-review-container {
    padding: 25px;
}

.sig-review-rating {
    margin-bottom: 15px;
}

.sig-review-rating .star {
    font-size: 18px;
    margin-right: 2px;
}

.sig-review-rating .star.filled {
    color: #f39c12;
}

.sig-review-text {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    font-style: italic;
    margin: 0 0 20px 0;
    padding: 0;
    border: none;
    position: relative;
}

.sig-review-text::before {
    content: """;
    font-size: 48px;
    color: #3498db;
    position: absolute;
    top: -10px;
    left: -20px;
    font-family: serif;
    opacity: 0.3;
}

.sig-review-author {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.sig-review-photo {
    flex-shrink: 0;
}

.sig-review-photo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
}

.sig-review-details {
    flex: 1;
}

.sig-client-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.sig-client-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.sig-client-company {
    margin: 0;
    font-size: 13px;
    color: #95a5a6;
    font-weight: 500;
}

/* Review style variations */
.sig-review-minimal {
    background: transparent;
    box-shadow: none;
    border-left: 4px solid #3498db;
    border-radius: 0;
}

.sig-review-minimal .sig-review-container {
    padding: 20px;
}

.sig-review-minimal .sig-review-text::before {
    display: none;
}

.sig-review-minimal .sig-review-author {
    border-top: none;
    padding-top: 15px;
}

.sig-review-featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sig-review-featured .sig-review-text {
    color: white;
}

.sig-review-featured .sig-review-text::before {
    color: rgba(255, 255, 255, 0.3);
}

.sig-review-featured .sig-client-name {
    color: white;
}

.sig-review-featured .sig-client-title {
    color: rgba(255, 255, 255, 0.8);
}

.sig-review-featured .sig-client-company {
    color: rgba(255, 255, 255, 0.7);
}

.sig-review-featured .sig-review-author {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.sig-review-featured .sig-review-photo img {
    border-color: white;
}

/* Responsive design for new blocks */
@media (max-width: 768px) {
    .sig-callout {
        padding: 15px;
        margin: 15px 0;
    }
    
    .sig-callout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sig-callout-icon {
        font-size: 20px;
    }
    
    .sig-callout-title {
        font-size: 16px;
    }
    
    .sig-review-container {
        padding: 20px;
    }
    
    .sig-review-author {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .sig-review-photo {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .sig-callout {
        padding: 12px;
    }
    
    .sig-callout-title {
        font-size: 15px;
    }
    
    .sig-callout-content p {
        font-size: 14px;
    }
    
    .sig-review-container {
        padding: 15px;
    }
    
    .sig-review-text {
        font-size: 14px;
    }
    
    .sig-review-photo img {
        width: 50px;
        height: 50px;
    }
}

/* Features Section Block Styles */
.wp-block-sig-features-section .ib-features-section,
.ib-features-section {
    padding: 80px 20px;
    box-sizing: border-box !important;
}

/* Full width support */
.wp-block-sig-features-section.alignwide {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.wp-block-sig-features-section.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Container */
.wp-block-sig-features-section .ib-container,
.ib-features-section .ib-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.wp-block-sig-features-section .ib-section-header,
.ib-section-header {
    text-align: center !important;
    margin-bottom: 60px !important;
}

.wp-block-sig-features-section .ib-section-title,
.ib-section-title {
    font-size: 42px !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    line-height: 1.2 !important;
}

.wp-block-sig-features-section .ib-section-subtitle,
.ib-section-subtitle {
    font-size: 20px !important;
    color: #666 !important;
    max-width: 700px !important;
    margin: 0 auto !important;
    line-height: 1.6 !important;
}

.wp-block-sig-features-section .ib-features-grid,
.ib-features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 40px !important;
    margin-top: 60px !important;
}

.wp-block-sig-features-section .ib-feature-card,
.ib-feature-card {
    background: white !important;
    padding: 40px 30px !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    position: relative !important;
    border: 1px solid #f0f0f0 !important;
}

.wp-block-sig-features-section .ib-feature-card:hover,
.ib-feature-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    border-color: #667eea !important;
}

.wp-block-sig-features-section .ib-feature-icon,
.ib-feature-icon {
    width: 80px !important;
    height: 80px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 20px !important;
    margin: 0 auto 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 36px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.wp-block-sig-features-section .ib-feature-title,
.ib-feature-title {
    font-size: 24px !important;
    margin-bottom: 15px !important;
    color: #333 !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.wp-block-sig-features-section .ib-feature-description,
.ib-feature-description {
    color: #666 !important;
    line-height: 1.7 !important;
    margin: 0 !important;
    font-size: 16px !important;
}

/* When icons are hidden, adjust spacing */
.ib-features-section:not(.show-icons) .ib-feature-card {
    padding-top: 30px;
}

/* Features section responsive design */
@media (max-width: 1024px) {
    .wp-block-sig-features-section .ib-features-grid,
    .ib-features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 30px !important;
    }
    
    .wp-block-sig-features-section .ib-section-title,
    .ib-section-title {
        font-size: 36px !important;
    }
    
    .wp-block-sig-features-section .ib-section-subtitle,
    .ib-section-subtitle {
        font-size: 18px !important;
    }
}

@media (max-width: 768px) {
    .wp-block-sig-features-section .ib-features-section,
    .ib-features-section {
        padding: 60px 15px !important;
    }
    
    .wp-block-sig-features-section .ib-container,
    .ib-features-section .ib-container {
        padding: 0 15px !important;
    }
    
    .wp-block-sig-features-section .ib-section-header,
    .ib-section-header {
        margin-bottom: 40px !important;
    }
    
    .wp-block-sig-features-section .ib-section-title,
    .ib-section-title {
        font-size: 28px !important;
        margin-bottom: 15px !important;
    }
    
    .wp-block-sig-features-section .ib-section-subtitle,
    .ib-section-subtitle {
        font-size: 16px !important;
    }
    
    .wp-block-sig-features-section .ib-features-grid,
    .ib-features-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        margin-top: 40px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-card,
    .ib-feature-card {
        padding: 30px 25px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-icon,
    .ib-feature-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 28px !important;
        margin-bottom: 20px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-title,
    .ib-feature-title {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-description,
    .ib-feature-description {
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .wp-block-sig-features-section .ib-features-section,
    .ib-features-section {
        padding: 40px 10px !important;
    }
    
    .wp-block-sig-features-section .ib-container,
    .ib-features-section .ib-container {
        padding: 0 10px !important;
    }
    
    .wp-block-sig-features-section .ib-section-title,
    .ib-section-title {
        font-size: 24px !important;
    }
    
    .wp-block-sig-features-section .ib-section-subtitle,
    .ib-section-subtitle {
        font-size: 15px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-card,
    .ib-feature-card {
        padding: 25px 20px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-icon,
    .ib-feature-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
        margin-bottom: 15px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-title,
    .ib-feature-title {
        font-size: 18px !important;
    }
    
    .wp-block-sig-features-section .ib-feature-description,
    .ib-feature-description {
        font-size: 14px !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sig-section {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .sig-section.has-background {
        background: #34495e;
    }
    
    .sig-section .wp-block-heading {
        color: #ecf0f1;
        border-bottom-color: #3498db;
    }
    
    .sig-section .wp-block-list li {
        border-bottom-color: #34495e;
    }
    
    .sig-template-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .sig-feature-item {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .sig-review {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .sig-review-text {
        color: #ecf0f1;
    }
    
    .sig-client-name {
        color: #ecf0f1;
    }
    
    .sig-review-author {
        border-top-color: #34495e;
    }
    
    /* Features section dark mode */
    .ib-features-section {
        background: #2c3e50;
    }
    
    .ib-section-title {
        color: #ecf0f1;
    }
    
    .ib-section-subtitle {
        color: #bdc3c7;
    }
    
    .ib-feature-card {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .ib-feature-title {
        color: #ecf0f1;
    }
    
    .ib-feature-description {
        color: #bdc3c7;
    }
}