/* SSC API Plugin - Fixed CSS */

/* Form container - Updated to match dynamic IDs */
[id^="sassa-form-section-"] {
    background-color: #FFFFFF;
    padding: 0px;
    margin-bottom: 20px;
}

/* Form styling - Updated to match dynamic IDs */
[id^="sassa-status-check-form-"] {
    margin: 0 auto;
    padding: 20px;
    background-color: #FDEAB4;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Input fields - More specific targeting */
[id^="sassa-status-check-form-"] input[type="text"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 0px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Labels styling */
[id^="sassa-status-check-form-"] label {
    margin-bottom: 0px;
    margin-top: 0px;
    color: #333;
}

/* Character count styling */
[id^="id-char-count-"], [id^="cell-char-count-"] {
    font-size: 14px;
    margin-bottom: 10px;
}

/* Checkbox styling */
[id^="sassa-status-check-form-"] input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

[id^="consent-checkbox-"] + label {
    display: inline !important;
    margin-left: 5px;
    font-weight: normal;
    cursor: pointer;
}


/* Response section styling */
[id^="sassa-response-section-"] {
    background-color: #FFFFFF;
    margin-top: 20px;
}

/* Loading icon */
[id^="loading-icon-"] {
    background-color: rgba(255, 255, 246, 0.8);
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin: 20px 0;
    font-size: 16px;
}

[id^="loading-icon-"] .fas {
    margin-right: 8px;
    color: #007bff;
}

.official-sassa-btn {
  background-color: #FBC02D;
  color: #222222;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none;
  display: inline-block;
}


/* Error messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}

/* Success messages */
.success-message {
    background-color: #FFFFFF;
    padding: 20px;
    margin-bottom: 0px;
    background-image: url('https://sassagrantcheck.co.za/wp-content/uploads/2024/05/sassa-grant-check-logo.webp');
    background-position: right bottom;
    background-repeat: no-repeat;
    background-size: 150px 150px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Server error message styling */
.server-error-message {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.server-error-message p {
    margin: 10px 0;
    color: #495057;
}

/* Error section styling */
[id^="error-section-"] {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f8d7da;
    border-radius: 8px;
}

.ssc-api-table {
    border: 1px solid black;
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse; /* Optional, for nicer borders */
}

/* Table container and styling */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 20px 0;
}

.table-container table {
    border-collapse: collapse;
    border-spacing: 0;
}

.table-container th,
.table-container td {
    padding: 5px 5px;
    text-align: left;
    border: 1px solid #ddd;
    word-wrap: break-word;
}

/* Header row style */
.table-container th {
    background-color: #FBC02D;
    color: #000000;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Alternating row colors */
.table-container tr:nth-child(even) {
    background-color: #FDEAB4;
}

.table-container tr:nth-child(odd) {
    background-color: #FFFFF6;
}

.table-container tr:hover {
    background-color: #fff3cd;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    [id^="sassa-status-check-form-"] {
        padding: 15px;
        margin: 10px;
    }
    
    [id^="sassa-status-check-form-"] input[type="text"] {
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    .table-container {
        font-size: 14px;
    }
    
    .table-container th,
    .table-container td {
        padding: 8px 4px;
    }
}

@media (max-width: 420px) {
    .success-message {
        background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), 
                         url('https://sassagrantcheck.co.za/wp-content/uploads/2024/05/sassa-grant-check-logo.webp');
        background-size: 100px 100px;
    }
    
    [id^="sassa-status-check-form-"] {
        padding: 10px;
    }
    
    .table-container {
        font-size: 12px;
    }
    
    [id^="send-button-"], [id^="download-pdf-"] {
        width: 100%;
        padding: 12px;
    }
}