/**
 * Presupuestos Pro - Public Styles
 */

/* Reset */
.pp-public-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f0f1f3;
    min-height: 100vh;
}

/* Container */
.pp-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.pp-header {
    text-align: center;
    padding: 30px 0;
}

.pp-logo {
    max-width: 200px;
    height: auto;
}

.pp-header h1 {
    color: #fff;
    margin: 0;
    font-size: 28px;
}

/* Main */
.pp-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Document */
.pp-document {
    padding: 40px;
}

.pp-document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.pp-document-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.pp-document-meta {
    text-align: right;
}

.pp-doc-number {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #D22044;
}

.pp-doc-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Status colors */
.pp-status-draft {
    background: #f0f0f1;
    color: #50575e;
}

.pp-status-sent {
    background: #dfe7f9;
    color: #2271b1;
}

.pp-status-viewed {
    background: #e5f3ff;
    color: #0073aa;
}

.pp-status-accepted {
    background: #d7f4d7;
    color: #00a32a;
}

.pp-status-rejected {
    background: #fcf0f1;
    color: #d63638;
}

.pp-status-expired {
    background: #f0f0f1;
    color: #8c8f94;
}

.pp-status-pending_signature {
    background: #fff8e5;
    color: #996800;
}

.pp-status-signed {
    background: #d7f4d7;
    color: #00a32a;
}

.pp-status-cancelled {
    background: #f0f0f1;
    color: #8c8f94;
}

.pp-status-not_renewed {
    background: #fef3cd;
    color: #856404;
}

/* Info Box */
.pp-info-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.pp-info-box h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pp-info-box p {
    margin: 5px 0;
}

/* Validity */
.pp-validity {
    background: #e5f3ff;
    color: #0073aa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pp-validity.expired {
    background: #fcf0f1;
    color: #d63638;
}

/* Items Table */
.pp-items-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.pp-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.pp-items-table th,
.pp-items-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.pp-items-table th {
    background: #D22044;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
}

.pp-items-table th:first-child {
    border-radius: 8px 0 0 0;
}

.pp-items-table th:last-child {
    border-radius: 0 8px 0 0;
}

.pp-items-table tbody tr:hover {
    background: #f9f9f9;
}

.pp-items-table .text-center {
    text-align: center;
}

.pp-items-table .text-right {
    text-align: right;
}

.pp-items-table small {
    color: #666;
}

/* Badge */
.pp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    background: #D22044;
    color: #fff;
    margin-top: 5px;
}

/* Totals */
.pp-totals {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.pp-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.pp-totals-row.total {
    font-size: 20px;
    font-weight: bold;
    color: #D22044;
    border-top: 2px solid #D22044;
    padding-top: 15px;
    margin-top: 10px;
}

/* Conditions */
.pp-conditions {
    background: #fffbeb;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin-bottom: 25px;
}

.pp-conditions h3 {
    margin: 0 0 10px;
    color: #92400e;
}

/* Actions Section */
.pp-actions-section {
    background: #f0f7ff;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.pp-actions-section h3 {
    margin: 0 0 20px;
    text-align: center;
}

/* Buttons */
.pp-btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.pp-btn-primary {
    background: #D22044;
    color: #fff;
}

.pp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(210, 32, 68, 0.4);
}

.pp-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.pp-btn-secondary:hover {
    background: #d1d5db;
}

.pp-btn-danger {
    background: #ef4444;
    color: #fff;
}

.pp-btn-danger:hover {
    background: #dc2626;
}

.pp-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.pp-btn-block {
    display: block;
    width: 100%;
}

.pp-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Consent Box */
.pp-consent-box {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pp-consent-box label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.pp-consent-box input[type="checkbox"] {
    margin-top: 3px;
}

/* Form Elements */
.pp-form-group {
    margin-bottom: 20px;
}

.pp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.pp-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.pp-input:focus {
    outline: none;
    border-color: #D22044;
}

.pp-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

/* Signature */
.pp-sign-section {
    background: #f0f7ff;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.pp-sign-section h3 {
    margin: 0 0 15px;
}

.pp-signature-container {
    margin: 20px 0;
}

.pp-signature-pad {
    width: 100%;
    height: 200px;
    border: 2px dashed #D22044;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
}

.pp-signature-actions {
    text-align: right;
    margin-top: 10px;
}

.pp-legal-notice {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    border-left: 4px solid #D22044;
}

/* Success Message */
.pp-success-message {
    text-align: center;
    padding: 40px;
}

.pp-success-message .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #00a32a;
    margin-bottom: 20px;
}

.pp-success-message p {
    font-size: 18px;
    color: #333;
}

/* Error Box */
.pp-error-box {
    text-align: center;
    padding: 60px 40px;
}

.pp-error-icon .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #d63638;
    margin-bottom: 20px;
}

/* Modal */
.pp-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

.pp-modal-content h3 {
    margin: 0 0 15px;
}

.pp-modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.pp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Access Form */
.pp-access-form-container {
    max-width: 400px;
    margin: 40px auto;
}

.pp-access-form-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pp-access-form-box h2 {
    margin: 0 0 10px;
    color: #333;
}

.pp-access-form-box>p {
    color: #666;
    margin-bottom: 25px;
}

.pp-access-form .pp-form-group {
    text-align: left;
}

/* Messages */
.pp-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.pp-message.success {
    background: #d7f4d7;
    color: #00a32a;
}

.pp-message.error {
    background: #fcf0f1;
    color: #d63638;
}

.pp-error {
    background: #fcf0f1;
    color: #d63638;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Footer */
.pp-footer {
    text-align: center;
    padding: 30px 0;
    color: #7b7f88;
}

.pp-footer p {
    margin: 0;
}

/* Contract Content */
.pp-contract-content {
    line-height: 1.8;
}

.pp-contract-content h2 {
    color: #333;
    border-bottom: 2px solid #D22044;
    padding-bottom: 10px;
}

.pp-contract-content h3 {
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .pp-document {
        padding: 25px;
    }

    .pp-document-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .pp-document-meta {
        text-align: center;
    }

    .pp-items-table {
        font-size: 14px;
    }

    .pp-items-table th,
    .pp-items-table td {
        padding: 10px;
    }

    .pp-action-buttons {
        flex-direction: column;
    }

    .pp-btn {
        width: 100%;
    }
}

/* Frontend Filters */
.pp-filters-form-frontend {
    margin-bottom: 0;
}

.pp-filter-row {
    background-color: #f8fafc;
}

.pp-filter-row td {
    padding: 8px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.pp-filter-row input[type="text"],
.pp-filter-row select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.pp-filter-row input[type="text"]:focus,
.pp-filter-row select:focus {
    border-color: #D22044;
    outline: none;
    box-shadow: 0 0 0 2px rgba(210, 32, 68, 0.1);
}

.pp-text-center {
    text-align: center;
}