/* Complaints Management System - Public CSS */

/* Main Container */
.cms-complaints-box {
    max-width: 950px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

/* Header */
.cms-box-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-box-title {
    font-size: 20px;
    font-weight: 600;
}

.cms-box-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cms-total-count {
    font-size: 14px;
    font-weight: 500;
}

.cms-custom-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.cms-custom-button:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* List */
.cms-box-list {
    background: white;
}

.cms-box-list table {
    width: 100%;
    border-collapse: collapse;
}

.cms-box-list thead {
    background: #f5f5f5;
}

.cms-box-list th {
    padding: 12px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.cms-box-list td {
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #555;
}

.cms-box-list tbody tr:hover {
    background: #f9f9f9;
}

.cms-box-list tbody tr:last-child td {
    border-bottom: none;
}

/* Footer */
.cms-box-footer {
    background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-add-complaint-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cms-add-complaint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cms-showing-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Modal */
.cms-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cms-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cms-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
}

.cms-modal-close:hover,
.cms-modal-close:focus {
    color: #000;
}

.cms-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

/* Form Styles */
.cms-complaint-form {
    margin-top: 20px;
}

.cms-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.cms-form-group {
    margin-bottom: 15px;
}

.cms-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cms-form-group .required {
    color: #d32f2f;
}

.cms-form-group input[type="text"],
.cms-form-group input[type="email"],
.cms-form-group input[type="tel"],
.cms-form-group input[type="number"],
.cms-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.cms-form-group input[type="text"]:focus,
.cms-form-group input[type="email"]:focus,
.cms-form-group input[type="tel"]:focus,
.cms-form-group input[type="number"]:focus,
.cms-form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

.cms-form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cms-help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.cms-math-quiz {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #4a90e2;
}

.cms-otp-section {
    margin: 20px 0;
}

.cms-send-otp-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cms-send-otp-btn:hover {
    background: #f57c00;
}

.cms-send-otp-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cms-otp-input {
    animation: slideDown 0.3s;
}

.cms-form-actions {
    margin-top: 25px;
    text-align: right;
}

.cms-submit-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cms-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cms-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.cms-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.cms-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.cms-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .cms-box-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .cms-box-header-right {
        flex-direction: column;
    }

    .cms-box-footer {
        flex-direction: column;
        gap: 10px;
    }

    .cms-form-row {
        grid-template-columns: 1fr;
    }

    .cms-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}

/* Loading Spinner */
.cms-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Dashboard */
.gps-user-dashboard,
.gps-single-submission-view {
    max-width: 950px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    padding: 20px 30px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.gps-user-dashboard h2,
.gps-single-submission-view h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.gps-user-submissions-table {
    width: 100%;
    border-collapse: collapse;
}

.gps-user-submissions-table thead {
    background: #f9f9f9;
}

.gps-user-submissions-table th,
.gps-user-submissions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.gps-user-submissions-table th {
    font-weight: 600;
}

.gps-button-small {
    background: #4a90e2;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
}

.gps-button-small:hover {
    background: #357abd;
    color: white;
}

.gps-back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #4a90e2;
    text-decoration: none;
    font-weight: 600;
}

.gps-submission-subject {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}

.gps-submission-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.gps-submission-message {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    line-height: 1.6;
    margin-bottom: 20px;
}

.gps-single-submission-view .gps-form {
    margin-top: 20px;
}

.gps-single-submission-view .gps-form-group {
    margin-bottom: 15px;
}

.gps-single-submission-view .gps-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.gps-single-submission-view .gps-form-group input[type="text"],
.gps-single-submission-view .gps-form-group select,
.gps-single-submission-view .gps-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gps-single-submission-view .gps-submit-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.gps-char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.gps-save-draft-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.gps-save-draft-btn:hover:not(:disabled) {
    background: #7f8c8d;
}

.gps-save-draft-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
