/* 
 * Facturación Inteligente CSS - CRM Dentistas iA
 * Estilos específicos para la landing de facturación inteligente
 */

/* Invoice Demo Styles - Hero Section */
.invoice-demo {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    overflow: hidden;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.invoice-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #12d8c3 0%, #06b7a5 100%);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

/* Header left content */
.invoice-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
}

.invoice-title > span {
    opacity: 0.95;
}

.invoice-meta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.invoice-meta .meta-sep {
    color: rgba(255, 255, 255, 0.6);
}

/* Header right status */
.invoice-ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.9rem;
}

.invoice-ai-status i {
    color: #ffffff;
}

/* Inverted invoice number style inside the header */
.invoice-header .invoice-number {
    background-color: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.invoice-header .invoice-number .hash,
.invoice-header .invoice-number .sep {
    color: rgba(255, 255, 255, 0.75);
}

.invoice-header .invoice-number .prefix,
.invoice-header .invoice-number .year,
.invoice-header .invoice-number .sequence {
    color: #ffffff;
}

.invoice-logo h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #212529;
    font-weight: 600;
}

.invoice-details {
    display: flex;
    gap: 20px;
}

.invoice-id, .invoice-date {
    display: flex;
    flex-direction: column;
}

.invoice-id span, .invoice-date span {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 2px;
}

.invoice-id strong, .invoice-date strong {
    font-size: 1rem;
    color: #212529;
}

/* Segmented invoice number badge */
.invoice-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    font-size: 1rem;
    line-height: 1;
    color: #212529;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.invoice-number .hash {
    color: #6c757d;
    margin-right: 2px;
}

.invoice-number .prefix {
    font-weight: 600;
    letter-spacing: 0.4px;
}

.invoice-number .sep {
    color: #adb5bd;
    margin: 0 2px;
}

.invoice-number .year,
.invoice-number .sequence {
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.invoice-client {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #e9ecef;
    background-color: #ffffff; /* keep body white */
}

.invoice-client .client-info {
    flex: 1;
}

.invoice-client .payment-status {
    margin-left: 16px;
}

.client-info h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #6c757d;
}

.client-info p {
    margin: 0 0 5px;
    font-size: 0.9rem;
    color: #212529;
}

.payment-status {
    text-align: right;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.status.pending {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffe69c;
}

.status.paid {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status.overdue {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c2c7;
}

.due-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.invoice-items {
    padding: 20px;
    background-color: #ffffff; /* keep body white */
}

.invoice-items table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-items th:last-child,
.invoice-items td:last-child {
    text-align: right;
    white-space: nowrap;
}

.invoice-items th {
    text-align: left;
    padding: 10px;
    font-size: 0.9rem;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.invoice-items td {
    padding: 10px;
    font-size: 0.9rem;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.invoice-items tbody tr:last-child td {
    border-bottom: none;
}

.invoice-items tfoot {
    border-top: 2px solid #dee2e6;
}

.invoice-items tfoot td {
    font-weight: 600;
    color: #212529;
}

.invoice-items tfoot td:last-child {
    font-size: 1.1rem;
    color: #06b7a5;
}

.invoice-actions {
    padding: 15px 20px;
    background-color: #ffffff; /* keep body white */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #d0e6f7;
}

.invoice-actions .action-buttons .btn-icon {
    border: 1px solid #e2e8f0; /* subtle border */
    background-color: #ffffff;  /* white icons background like screenshot */
}

.invoice-actions .btn-icon.primary {
    background-color: #06b7a5;
    border-color: #06b7a5;
    color: #ffffff;
}

.ai-recommendation {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #0e7f75;
    padding: 5px 12px;
    border-radius: 20px;
    background-color: rgba(6, 183, 165, 0.12);
}

.ai-recommendation.active {
    animation: pulse-light 2s infinite;
}

@keyframes pulse-light {
    0% { background-color: rgba(6, 183, 165, 0.12); }
    50% { background-color: rgba(6, 183, 165, 0.22); }
    100% { background-color: rgba(6, 183, 165, 0.12); }
}

.ai-recommendation i {
    color: #06b7a5;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #f8f9fa;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.btn-icon.primary {
    background-color: #007bff;
    color: white;
}

/* Payment Analytics Demo Styles */
.payment-analytics-demo {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 100%;
}

.analytics-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--fisio-primary, #09b4a3) 0%, #00c3b0 100%);
    border-bottom: 1px solid #e9ecef;
}

.analytics-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.analytics-body {
    padding: 20px;
}

.chart-container {
    margin-bottom: 25px;
}

.chart-title {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
}

.pie-chart {
    position: relative;
    width: clamp(140px, 32vw, 180px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: conic-gradient(
        #20B2AA 0% 45%,
        #34a853 45% 70%,
        #fbbc05 70% 85%,
        #ea4335 85% 100%
    );
    overflow: hidden;
}

.payment-analytics-demo .pie-chart .chart-segment { display: none; }

.chart-segment:nth-child(1) {
    z-index: 4;
    transform: rotate(0deg);
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%);
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
}

.chart-segment:nth-child(2) {
    z-index: 3;
    transform: rotate(162deg);
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%);
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
}

.chart-segment:nth-child(3) {
    z-index: 2;
    transform: rotate(252deg);
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%);
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
}

.chart-segment:nth-child(4) {
    z-index: 1;
    transform: rotate(306deg);
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%);
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
}

.chart-center {
    position: absolute;
    width: 60%;
    height: 60%;
    background-color: white;
    border-radius: 50%;
    top: 20%;
    left: 20%;
    z-index: 5;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #495057;
    margin-right: 10px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.analytics-metrics {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.metric {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.metric-title {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.metric-trend {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
}

.metric-trend.positive {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.metric-trend.negative {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Reminder System Demo Styles */
.reminder-system-demo {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 100%;
}

.reminder-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--fisio-primary, #09b4a3) 0%, #00c3b0 100%);
    border-bottom: 1px solid #e9ecef;
}

.reminder-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.reminder-body {
    padding: 20px;
}

.reminders-list {
    margin-bottom: 20px;
}

.reminder-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
}

.reminder-item:last-child {
    margin-bottom: 0;
}

.reminder-item.scheduled {
    border-left: 4px solid #007bff;
}

.reminder-item.sent {
    border-left: 4px solid #ffc107;
}

.reminder-item.paid {
    border-left: 4px solid #28a745;
}

.reminder-status {
    margin-right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reminder-item.scheduled .reminder-status {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.reminder-item.sent .reminder-status {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.reminder-item.paid .reminder-status {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.reminder-content {
    flex: 1;
}

.reminder-content h5 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: #212529;
}

.reminder-content p {
    margin: 0 0 3px;
    font-size: 0.9rem;
    color: #495057;
}

.reminder-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.reminder-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
}

.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background-color: #e9f5ff;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0056b3;
}

.ai-suggestion i {
    color: #007bff;
    font-size: 1.1rem;
}

.ai-suggestion.active {
    border: 1px solid rgba(0, 123, 255, 0.3);
    animation: pulse-light 2s infinite;
}

/* Integration Demo Styles */
.integration-demo {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.integration-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--fisio-primary, #09b4a3) 0%, #00c3b0 100%);
    border-bottom: 1px solid #e9ecef;
}

.integration-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.integration-body {
    padding: 25px 20px;
    flex: 1;
}

.integration-flow {
    display: flex;
    flex-direction: column;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.flow-step.active {
    background-color: rgba(6, 183, 165, 0.1);
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.flow-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.flow-step.active .flow-icon {
    color: #06b7a5;
    background-color: rgba(6, 183, 165, 0.1);
}

.flow-content h5 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: #212529;
}

.flow-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.flow-arrow {
    display: flex;
    justify-content: center;
    padding: 5px 0;
    color: #adb5bd;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .invoice-demo,
    .payment-analytics-demo,
    .reminder-system-demo,
    .integration-demo {
        margin-top: 30px;
    }
    
    .invoice-header,
    .invoice-client {
        flex-direction: column;
    }
    
    .invoice-details,
    .payment-status {
        margin-top: 15px;
    }
    
    .analytics-metrics {
        flex-direction: column;
    }
    
    .metric {
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .chart-legend {
        flex-direction: column;
    }
    
    .invoice-items table {
        display: block;
        overflow-x: auto;
    }
    
    .reminder-item {
        flex-direction: column;
    }
    
    .reminder-status {
        margin-bottom: 10px;
    }
    
    .reminder-amount {
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .action-buttons {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn-icon {
        width: 30px;
        height: 30px;
    }
}
