/**
 * Civil Trans Receipts - Frontend Styles
 */

/* Form wrapper */
.ctr-receipt-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.ctr-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Form rows */
.ctr-form-row {
    margin-bottom: 20px;
}

.ctr-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.ctr-form-row label .required {
    color: #dc3545;
}

/* Input styling */
.ctr-form-row input[type="text"],
.ctr-form-row input[type="number"],
.ctr-form-row input[type="date"],
.ctr-form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ctr-form-row input:focus,
.ctr-form-row select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Currency input group */
.ctr-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ctr-currency {
    position: absolute;
    left: 15px;
    color: #666;
    font-weight: 600;
    font-size: 16px;
}

.ctr-input-group input {
    padding-left: 35px !important;
}

/* GST row */
.ctr-gst-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.ctr-gst-row > label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
}

.ctr-gst-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #2196F3;
}

.ctr-gst-display {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.ctr-gst-label {
    color: #666;
    margin-right: 5px;
}

.ctr-gst-value {
    font-weight: 600;
    color: #333;
}

/* Percentage slider */
.ctr-percent-input {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.ctr-percent-input input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 4px;
    outline: none;
}

.ctr-percent-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #2196F3;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ctr-percent-input input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #2196F3;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ctr-percent-value-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ctr-percent-value-wrapper input[type="number"] {
    width: 70px;
    text-align: center;
    padding: 8px;
}

.ctr-claimable-display {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    border-left: 4px solid #2196F3;
}

.ctr-claimable-label {
    color: #1565C0;
}

.ctr-claimable-value {
    font-weight: 700;
    color: #1565C0;
    font-size: 16px;
}

/* Other shop row */
.ctr-other-shop-row {
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #ccc;
}

.ctr-other-shop-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ctr-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    font-size: 14px;
    cursor: pointer;
}

.ctr-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

/* File upload */
.ctr-file-upload {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ctr-file-upload:hover {
    border-color: #2196F3;
    background-color: #fafafa;
}

.ctr-file-upload.dragover {
    border-color: #2196F3;
    background-color: #e3f2fd;
}

.ctr-file-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    cursor: pointer;
}

.ctr-file-preview {
    margin-top: 15px;
}

.ctr-file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ctr-file-name {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.ctr-file-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #888;
}

/* Submit button */
.ctr-submit-row {
    margin-top: 30px;
}

.ctr-submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ctr-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.ctr-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ctr-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Spinner */
.ctr-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ctr-spin 0.8s linear infinite;
}

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

/* Messages */
.ctr-form-messages {
    margin-bottom: 20px;
}

.ctr-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    font-weight: 500;
}

.ctr-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    font-weight: 500;
}

.ctr-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ctr-receipt-form-wrapper {
        padding: 10px;
    }
    
    .ctr-form {
        padding: 20px;
    }
    
    .ctr-gst-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ctr-percent-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ctr-percent-input input[type="range"] {
        width: 100%;
    }
    
    .ctr-percent-value-wrapper {
        justify-content: center;
    }
}
