/**
 * TelecomCredit Payment Plugin - Frontend Styles
 */

/* Form Container */
.tcp-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tcp-form-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
    font-size: 1.5rem;
}

.tcp-description {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

/* Form Groups */
.tcp-form-group {
    margin-bottom: 1.5rem;
}

.tcp-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.tcp-form-group .required {
    color: #dc3545;
}

.tcp-form-group input[type="text"],
.tcp-form-group input[type="email"],
.tcp-form-group input[type="tel"],
.tcp-form-group input[type="number"],
.tcp-form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.tcp-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.tcp-form-group input.error {
    border-color: #dc3545;
}

.tcp-form-group .tcp-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Amount Display */
.tcp-amount-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.tcp-amount-display strong {
    font-size: 1.25rem;
    color: #007cba;
}

.tcp-initial-payment {
    background: #e7f3ff;
    border: 1px solid #007cba;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.tcp-initial-payment strong {
    color: #007cba;
    font-size: 1.1rem;
}

/* Amount Input with Unit */
.tcp-form-group input[type="number"] {
    width: calc(100% - 2rem);
    display: inline-block;
}

.tcp-unit {
    display: inline-block;
    padding: 0.75rem 0.5rem;
    margin-left: 0.5rem;
    color: #6c757d;
    font-weight: 500;
    vertical-align: top;
}

/* Form Submit */
.tcp-form-submit {
    text-align: center;
    margin-top: 2rem;
}

.tcp-submit-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    min-width: 200px;
}

.tcp-submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.tcp-submit-btn:active {
    transform: translateY(0);
}

.tcp-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.tcp-loading {
    color: #007cba;
    font-weight: 500;
    margin-top: 1rem;
}

.tcp-loading::after {
    content: "";
    animation: tcp-spinner 1s linear infinite;
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    margin-left: 0.5rem;
}

@keyframes tcp-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.tcp-form-messages {
    margin-top: 1rem;
}

.tcp-message {
    padding: 0.875rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

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

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

.tcp-message.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Quick Payment Button */
.tcp-quick-payment {
    background: #007cba;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.tcp-quick-payment:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.tcp-quick-payment:active {
    transform: translateY(0);
}

.tcp-quick-payment:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Status Badges */
.tcp-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tcp-status-active,
.tcp-status-completed {
    background: #d4edda;
    color: #155724;
}

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

.tcp-status-payment_failed,
.tcp-status-failed,
.tcp-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Tables */
.tcp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.tcp-table th,
.tcp-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.tcp-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.tcp-table tr:hover {
    background: #f8f9fa;
}

/* No Data Message */
.tcp-no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    font-style: italic;
}

/* Error Messages */
.tcp-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcp-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .tcp-form-group input[type="number"] {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .tcp-unit {
        display: block;
        margin-left: 0;
        text-align: left;
        padding: 0.25rem 0;
    }
    
    .tcp-submit-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .tcp-table {
        font-size: 0.875rem;
    }
    
    .tcp-table th,
    .tcp-table td {
        padding: 0.5rem;
    }
}

/* Accessibility */
.tcp-form-container input:focus,
.tcp-submit-btn:focus,
.tcp-quick-payment:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .tcp-form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .tcp-submit-btn,
    .tcp-quick-payment {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tcp-form-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .tcp-form-group label {
        color: #e2e8f0;
    }
    
    .tcp-form-group input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .tcp-form-group input:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.25);
    }
    
    .tcp-amount-display {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .tcp-table th {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .tcp-table tr:hover {
        background: #4a5568;
    }
}