/* Frontend CSS for Simple PayPal Invoice Manager */

/* Client Invoices Container */
.spim-client-invoices {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Security Verification */
.spim-security-verification {
    text-align: center;
    padding: 30px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.spim-security-verification h2 {
    margin-bottom: 20px;
    color: #333;
}

.spim-form-row {
    margin-bottom: 20px;
}

.spim-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.spim-form-row input[type="text"],
.spim-form-row input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.spim-form-row button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.spim-form-row button:hover {
    background-color: #005177;
}

.spim-resend-code {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Messages */
.spim-success-message,
.spim-error-message {
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.spim-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.spim-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Invoice Display */
.spim-invoice {
    padding: 30px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.spim-invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.spim-company-info h2 {
    margin-top: 0;
    color: #333;
}

.spim-invoice-info {
    text-align: right;
}

.spim-invoice-info h1 {
    color: #0073aa;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 15px;
}

.spim-invoice-status {
    display: inline-block;
    padding: 4px 10px;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 10px;
}

.spim-invoice-status.paid span {
    color: #28a745;
}

.spim-invoice-status.unpaid span {
    color: #dc3545;
}

.spim-client-info {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.spim-client-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
}

.spim-invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.spim-invoice-items th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

.spim-invoice-items td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

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

.spim-amount {
    text-align: right;
    font-weight: 600;
}

.spim-invoice-totals {
    margin-left: auto;
    max-width: 350px;
}

.spim-invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.spim-invoice-total-row:last-child {
    border-bottom: none;
}

.spim-invoice-grand-total {
    font-weight: 700;
    font-size: 1.2em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #dee2e6;
}

.spim-payment-options {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.spim-payment-options h3 {
    margin-bottom: 15px;
    color: #333;
}

.spim-paypal-button {
    margin-top: 15px;
}

.spim-invoice-actions {
    margin-top: 30px;
    text-align: right;
}

.spim-print-invoice {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.spim-print-invoice:hover {
    background-color: #005177;
}

/* Loading Indicator */
.spim-loading {
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(0, 115, 170, 0.2);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
button.loading {
    position: relative;
    color: transparent !important;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .spim-invoice,
    .spim-invoice * {
        visibility: visible;
    }
    
    .spim-invoice {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
    }
    
    .spim-invoice-actions,
    .spim-payment-options {
        display: none;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .spim-invoice-header {
        flex-direction: column;
    }
    
    .spim-invoice-info {
        text-align: left;
        margin-top: 20px;
    }
    
    .spim-invoice-items {
        font-size: 14px;
    }
    
    .spim-invoice-items th,
    .spim-invoice-items td {
        padding: 8px;
    }
    
    .spim-invoice-totals {
        max-width: 100%;
    }
}