/* ============================================
   Student Complaint Form - Professional Design
   ============================================ */

/* Reset any conflicting styles */
.complaint-wrapper .form-grid,
.complaint-form .form-grid,
#complaint-form-section .form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Ensure form grid displays correctly */
.complaint-form .form-grid,
#complaint-form-section .form-grid,
.form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px 30px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.form-grid > .form-group:not(.full-width) {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    grid-column: span 1 !important;
}

.form-grid > .form-group input,
.form-grid > .form-group select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 48px !important;
    height: 48px !important;
}

/* Fix for bootstrap-select invisible select overlay issue */
.form-grid > .form-group .bootstrap-select select {
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    bottom: 0;
    left: 50%;
    border: none;
}

/* Ensure Current Session dropdown stays at half width (50%) */
#current_session {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure dropdown toggle buttons match field width */
.form-group .dropdown-toggle,
.form-group .btn.dropdown-toggle,
.form-group button.dropdown-toggle {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

/* Bootstrap Select plugin compatibility */
.form-group .bootstrap-select,
.form-group .bootstrap-select > .dropdown-toggle {
    width: 100% !important;
    max-width: 100% !important;
}

.form-group .filter-option {
    width: 100% !important;
    text-align: left !important;
}

/* Ensure dropdown button container matches select width */
.form-group .btn-group,
.form-group .btn-group-vertical {
    width: 100% !important;
}

.form-group.full-width {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

.complaint-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    background: transparent;
    min-height: 100vh;
    animation: fadeIn 0.6s ease-in;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.complaint-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 35px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.8s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.complaint-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

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

.complaint-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.complaint-hero-text {
    position: relative;
    z-index: 1;
}

.complaint-hero-text h2 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.complaint-hero-text p {
    margin: 0;
    opacity: 0.95;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 300;
}

/* Card Container */
.complaint-stack {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.complaint-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Allow dropdowns to overflow the card */
.complaint-card:has(select:focus) {
    overflow: visible;
    z-index: 1000;
}

.complaint-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.complaint-card .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    position: relative;
}

.complaint-card .header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.complaint-card .header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.complaint-card .body {
    padding: 40px;
    overflow: visible;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Mode Toggle */
.complaint-mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.btn-mode {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    overflow: hidden;
}

.btn-mode::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-mode:hover::before {
    width: 300px;
    height: 300px;
}

.btn-mode:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.btn-mode.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
}

/* Search Section */
.search-section {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.search-section:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Form Styles */
.complaint-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    display: block !important;
}

.form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-flow: row;
    gap: 25px 30px;
    margin-bottom: 30px;
    align-items: start;
    width: 100% !important;
    box-sizing: border-box !important;
    clear: both;
    position: relative !important;
    overflow: visible !important;
}

/* Force grid layout - override any conflicting styles */
.complaint-form .form-grid,
#complaint-form-section .form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

.form-group {
    display: flex !important;
    flex-direction: column;
    position: relative;
    min-width: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-bottom: 0;
    margin-bottom: 0;
    transition: padding-bottom 0.2s ease;
    overflow: visible !important;
}

/* Reserve space for error messages to prevent layout shift */
.form-group.error {
    padding-bottom: 22px;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: span 1 !important;
    position: relative !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
}

.form-group.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

/* Ensure equal width and alignment for two-column fields */
.form-grid > .form-group:not(.full-width) {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    grid-column: span 1 !important;
    position: relative !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Ensure error state doesn't break grid layout - prevent shifting */
.form-grid > .form-group:not(.full-width).error {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}

/* Explicitly set first two form-groups to be in first row */
.form-grid > .form-group:nth-child(1):not(.full-width),
.form-grid > .form-group:nth-child(2):not(.full-width) {
    grid-row: 1;
}

/* Explicitly set next two form-groups to be in second row */
.form-grid > .form-group:nth-child(3):not(.full-width),
.form-grid > .form-group:nth-child(4):not(.full-width) {
    grid-row: 2;
}

/* Explicitly set next two form-groups to be in third row (Email and Detail) */
.form-grid > .form-group:nth-child(5):not(.full-width),
.form-grid > .form-group:nth-child(6):not(.full-width) {
    grid-row: 3;
}

/* Ensure all inputs and selects fill their containers */
.form-grid > .form-group input,
.form-grid > .form-group select,
.form-grid > .form-group textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: block;
    flex: 1 1 auto;
}

/* Specific height consistency for text inputs and selects */
.form-grid > .form-group input[type="text"],
.form-grid > .form-group input[type="email"],
.form-grid > .form-group select {
    min-height: 48px !important;
    height: 48px !important;
    line-height: 1.5;
}

/* Ensure selects match input field width exactly */
.form-grid > .form-group select {
    width: 100% !important;
    max-width: 100% !important;
}

.form-group label {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.form-group .required {
    color: #e53e3e;
    font-weight: 700;
    font-size: 16px;
}

/* Input Fields */
.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #ffffff;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0;
    display: block;
}

/* Ensure selects in form-grid match inputs exactly */
.form-grid .form-group select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px) scale(1.01);
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
    }
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box;
    line-height: 1.5;
    height: 48px !important;
    min-height: 48px !important;
    /* Match input field styling exactly */
    flex: 1 1 auto;
    align-self: stretch;
    position: relative;
}

/* Strategy: Ensure dropdowns can render outside container bounds */
.form-group {
    position: relative;
    z-index: 1;
}

/* When select is active/focused, bring it and its parents to front */
.form-group:focus-within,
.form-group:has(select:focus),
.form-group:has(select:active) {
    z-index: 1000 !important;
    position: relative;
}

.form-group select {
    position: relative;
    z-index: 1;
}

.form-group select:focus,
.form-group select:active {
    z-index: 1001 !important;
    position: relative;
    outline: none;
}

/* Ensure parent containers allow overflow when dropdown is open */
.complaint-card:has(select:focus) .body,
.complaint-card:has(select:active) .body {
    overflow: visible !important;
}

.form-grid:has(select:focus),
.form-grid:has(select:active) {
    overflow: visible !important;
    z-index: 1000;
}

/* Fallback for browsers that don't support :has() */
.complaint-card .body {
    position: relative;
}

.form-grid {
    position: relative;
}

/* Ensure wrapper allows overflow */
.complaint-wrapper {
    position: relative;
    overflow: visible;
}

/* Ensure select matches input field appearance */
.form-group select option {
    padding: 12px 16px;
    background: #ffffff;
    color: #2d3748;
}

.form-group select option:hover {
    background: #f7fafc;
}

.form-group select option:checked {
    background: #667eea;
    color: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
    font-family: inherit;
}

/* Full-width fields get special styling */
.form-group.full-width {
    margin-top: 5px;
    clear: both;
}

.form-group.full-width:first-of-type {
    margin-top: 0;
}

/* Ensure proper alignment and equal heights for two-column layout */
.form-grid > .form-group:not(.full-width) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

/* Visual consistency - ensure labels align properly */
.form-grid > .form-group label {
    height: auto;
    min-height: 22px;
    flex-shrink: 0;
}

/* Ensure inputs are properly aligned within their containers */
.form-grid > .form-group > input,
.form-grid > .form-group > select,
.form-grid > .form-group > textarea {
    flex: 1 1 auto;
    align-self: stretch;
    width: 100% !important;
    max-width: 100% !important;
}

/* Specific rule for select elements to match input width exactly */
.form-grid > .form-group:has(select) select,
.form-grid > .form-group select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Fallback for browsers that don't support :has() */
.form-grid > .form-group select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Add visual grouping for better organization */
.form-grid > .form-group:not(.full-width):nth-child(1),
.form-grid > .form-group:not(.full-width):nth-child(2) {
    margin-bottom: 0;
}

.form-grid > .form-group:not(.full-width):nth-child(3),
.form-grid > .form-group:not(.full-width):nth-child(4) {
    margin-top: 0;
}

/* Reserve space for error messages to prevent layout shift */
.form-group {
    position: relative;
    min-height: auto;
    margin-bottom: 0;
    padding-bottom: 0;
    transition: padding-bottom 0.2s ease;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Add padding when error occurs to reserve space and prevent layout shift */
.form-group.error {
    padding-bottom: 22px;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: span 1 !important;
    position: relative !important;
    overflow: visible !important;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1) !important;
    background-color: #fff5f5 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.form-group.error label {
    color: #e53e3e !important;
}

/* Error message styling - positioned at bottom of reserved space */
.error-message {
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    white-space: nowrap;
    z-index: 10;
    background-color: transparent;
    pointer-events: none;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Success state styling */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #38a169 !important;
    box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.1) !important;
}

.form-group.success label {
    color: #38a169 !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center !important; /* Centered position */
    gap: 15px;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    clear: both !important;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    color: white;
    min-width: 250px;
    padding: 16px 45px;
    border-radius: 50px; /* Modern Pill shape */
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(74, 0, 224, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(74, 0, 224, 0.4);
    background: linear-gradient(135deg, #5c0cf5 0%, #a045f5 100%);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition: transform 0.1s;
}

.btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #ffffff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #5568d3;
    color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Status Display */
.complaint-status {
    margin-top: 35px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border-left: 5px solid #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.complaint-status:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

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

.complaint-status h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.complaint-status h3::before {
    content: '📋';
    font-size: 24px;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-info p {
    margin: 0;
    font-size: 15px;
    color: #4a5568;
    line-height: 1.8;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.status-info strong {
    color: #2d3748;
    margin-right: 10px;
    font-weight: 600;
    min-width: 140px;
    display: inline-block;
}

/* Special styling for CAO Helpline Executive Comment */
.status-info p:last-child {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    border: 2px solid #f97316;
    border-left: 6px solid #f97316;
    padding: 18px 20px;
    box-shadow: 0 3px 12px rgba(249, 115, 22, 0.15);
}

.status-info p:last-child strong {
    color: #c2410c;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fed7aa;
}

.status-info p:last-child strong::before {
    content: '💬';
    margin-right: 8px;
    font-size: 16px;
}

.status-info p:last-child span {
    display: block;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
    margin-top: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #fb923c;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge.status-pending {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: #744210;
}

.status-badge.status-resubmit {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: #7c2d12;
}

.status-badge.status-file-reupload {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
}

.status-badge.status-in-progress {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.status-badge.status-complete {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.status-badge.status-rejected {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

/* Responsive Design - Tablet and Mobile */
@media (max-width: 768px) {
    .complaint-wrapper {
        padding: 20px 15px !important;
    }
    
    .complaint-hero {
        padding: 30px 20px !important;
    }
    
    .complaint-hero-text h2 {
        font-size: 24px !important;
    }
    
    .complaint-hero-text p {
        font-size: 15px !important;
    }
    
    .complaint-card .body {
        padding: 25px 20px !important;
    }
    
    .complaint-card .header h2 {
        font-size: 20px !important;
    }
    
    /* Form Grid - Single Column on Mobile (each input in its own row, full width) */
    .complaint-form .form-grid,
    #complaint-form-section .form-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
        grid-auto-flow: row !important;
        gap: 20px !important;
        width: 100% !important;
        display: grid !important;
        margin-bottom: 20px !important;
    }
    
    /* All form groups take full width - each in its own row - Override all desktop rules */
    .form-grid > .form-group,
    .form-grid > .form-group:nth-child(1),
    .form-grid > .form-group:nth-child(2),
    .form-grid > .form-group:nth-child(3),
    .form-grid > .form-group:nth-child(4),
    .form-group:nth-child(5),
    .form-grid > .form-group:nth-child(6) {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        clear: both !important;
        float: none !important;
    }
    
    /* Full-width fields (Email and Complaint Detail) */
    .form-group.full-width {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .form-group {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* All Input Fields - Full width, each in its own row */
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        height: auto !important;
        padding: 12px 14px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        box-sizing: border-box !important;
        display: block !important;
        position: relative !important;
        clear: both !important;
        float: none !important;
    }
    
    .form-group select {
        height: 48px !important;
        min-height: 48px !important;
    }
    
    .form-group textarea {
        min-height: 120px !important;
        resize: vertical;
    }
    
    /* Labels */
    .form-group label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        display: block !important;
        width: 100% !important;
    }
    
    /* Prevent any overlap or positioning issues */
    .form-grid > .form-group:not(.full-width):nth-child(1),
    .form-grid > .form-group:not(.full-width):nth-child(2),
    .form-grid > .form-group:not(.full-width):nth-child(3),
    .form-grid > .form-group:not(.full-width):nth-child(4) {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Ensure proper spacing between rows */
    .form-grid > .form-group + .form-group {
        margin-top: 0 !important;
    }
    
    /* Form Actions */
    .form-actions {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .btn {
        width: 100% !important;
        padding: 16px !important;
        font-size: 15px !important;
    }
    
    /* Mode Toggle */
    .complaint-mode-toggle {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .btn-mode {
        width: 100% !important;
        padding: 14px 20px !important;
    }
    
    /* Search Section */
    .search-section {
        padding: 20px !important;
    }
    
    /* Status Display */
    .complaint-status {
        padding: 20px !important;
        margin-top: 25px !important;
    }
    
    .status-info {
        gap: 12px !important;
    }
    
    .status-info strong {
        min-width: auto !important;
        display: block !important;
        margin-bottom: 5px !important;
        margin-right: 0 !important;
    }
    
    .status-info p {
        padding: 10px !important;
        font-size: 14px !important;
    }
}

/* Small Mobile Devices - Single Column Layout */
@media (max-width: 480px) {
    .complaint-wrapper {
        padding: 15px 10px !important;
    }
    
    .complaint-card .body {
        padding: 20px 15px !important;
    }
    
    .complaint-hero {
        padding: 25px 15px !important;
    }
    
    .complaint-hero-text h2 {
        font-size: 20px !important;
    }
    
    .complaint-hero-text p {
        font-size: 14px !important;
    }
    
    /* Single column layout for very small mobile devices */
    .complaint-form .form-grid,
    #complaint-form-section .form-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* All form groups take full width */
    .form-grid > .form-group {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .form-group.full-width {
        grid-column: 1 !important;
        width: 100% !important;
    }
    
    /* Ensure inputs fit properly in single column */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important;
        width: 100% !important;
    }
    
    /* Labels smaller on very small screens */
    .form-group label {
        font-size: 13px !important;
    }
    
    /* Buttons - Touch-friendly */
    .btn {
        min-height: 44px !important;
    }
    
    .btn-mode {
        min-height: 44px !important;
    }
}

/* Touch-friendly enhancements for all mobile devices */
@media (max-width: 768px) {
    /* Ensure all interactive elements are touch-friendly */
    input, select, textarea, button {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        touch-action: manipulation;
    }
    
    /* Prevent zoom on input focus (iOS Safari) - Critical for mobile UX */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
    
    /* Better touch targets - minimum 44x44px for accessibility */
    .btn, .btn-mode {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Ensure inputs don't get cut off on small screens */
    input, select, textarea {
        max-width: 100% !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
}

/* Loading State */
.btn-primary:disabled::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Form Group Animations */
.form-group {
    animation: fadeInUp 0.5s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }

/* Search Section Animation */
.search-section {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Success Animation */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.success-message {
    animation: successPulse 0.6s ease;
}

/* Error Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.error {
    animation: shake 0.5s ease;
}

/* Smooth transitions for mode switching */
#search-section,
#complaint-form-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#search-section[style*="display: none"],
#complaint-form-section[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
}

/* Status Badge Animation */
.status-badge {
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Floating animation for hero */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.complaint-hero::before {
    animation: float 6s ease-in-out infinite;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Resubmit Alert Banner
   ============================================ */

.resubmit-alert {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border: 3px solid #f97316;
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    animation: slideInDown 0.6s ease-out, pulse 2s ease-in-out infinite;
}

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

.resubmit-alert-icon {
    font-size: 48px;
    line-height: 1;
    animation: rotate 3s linear infinite;
    flex-shrink: 0;
}

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

.resubmit-alert-content {
    flex: 1;
}

.resubmit-alert-content h3 {
    margin: 0 0 10px 0;
    color: #7c2d12;
    font-size: 24px;
    font-weight: 700;
}

.resubmit-alert-content .resubmit-message {
    margin: 0 0 15px 0;
    color: #9a3412;
    font-size: 16px;
    line-height: 1.5;
}

.resubmit-reason-box {
    background: white;
    border: 2px solid #f97316;
    border-radius: 12px;
    padding: 0;
    margin-top: 15px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2);
    overflow: hidden;
}

.resubmit-reason-box strong {
    display: block;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    padding: 15px 20px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
    position: relative;
}

.resubmit-reason-box strong::before {
    content: '💬';
    margin-right: 10px;
    font-size: 18px;
}

.resubmit-reason-box p {
    margin: 0;
    padding: 20px 25px;
    color: #1f2937;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.8;
    white-space: pre-wrap;
    background: linear-gradient(to bottom, #fff7ed 0%, #ffffff 100%);
    border-top: 1px solid #fed7aa;
}

.resubmit-reason-box p::before {
    content: '"';
    font-size: 32px;
    color: #f97316;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 0;
    vertical-align: -8px;
    margin-right: 5px;
}

.resubmit-reason-box p::after {
    content: '"';
    font-size: 32px;
    color: #f97316;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 0;
    vertical-align: -8px;
    margin-left: 5px;
}

/* ============================================
   Status Timeline
   ============================================ */

.status-timeline {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s ease-out;
}

.status-timeline h3 {
    margin: 0 0 25px 0;
    color: #2d3748;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.timeline-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 600px;
    margin: 0 auto;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 4px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.4s ease;
}

.timeline-step.active .timeline-dot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.timeline-step.completed .timeline-dot {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-color: #48bb78;
}

.timeline-step.completed .timeline-dot::after {
    content: '✓';
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.timeline-step.rejected .timeline-dot {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border-color: #f56565;
}

.timeline-step.rejected .timeline-dot::after {
    content: '✗';
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.timeline-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    text-align: center;
    transition: all 0.3s ease;
}

.timeline-step.active .timeline-label {
    color: #667eea;
    font-size: 14px;
    font-weight: 700;
}

.timeline-step.completed .timeline-label {
    color: #38a169;
}

.timeline-step.rejected .timeline-label {
    color: #e53e3e;
}

.timeline-line {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    position: relative;
    min-width: 60px;
    max-width: 120px;
}

.timeline-line.completed {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .timeline-line {
        width: 4px;
        height: 40px;
        min-width: auto;
        max-width: none;
    }
    
    .timeline-step {
        flex-direction: row;
        gap: 15px;
        width: 100%;
    }
    
    .timeline-label {
        text-align: left;
    }
}

/* Print Styles */
@media print {
    .complaint-wrapper {
        background: white;
        padding: 0;
    }
    
    .complaint-mode-toggle,
    .form-actions,
    .btn {
        display: none;
    }
    
    .complaint-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .resubmit-alert {
        page-break-inside: avoid;
    }
    
    .status-timeline {
        page-break-inside: avoid;
    }
}


/* Search Type Toggle Styles */
.search-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #ffffff;
    padding: 5px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-search-type {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.btn-search-type:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    transform: translateY(-1px);
}

.btn-search-type.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.search-input-group {
    animation: fadeIn 0.4s ease;
}

/* Registration Number Search Results Section */
.regno-results-section {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.5s ease-out;
}

.regno-results-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.regno-results-section h3 span {
    color: #667eea;
    font-weight: 700;
}

/* Table Styles for Results */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.complaints-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.complaints-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.complaints-table thead th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.complaints-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.complaints-table tbody tr:hover {
    background: #f7fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.complaints-table tbody tr:last-child {
    border-bottom: none;
}

.complaints-table tbody td {
    padding: 14px 12px;
    font-size: 14px;
    color: #2d3748;
}

.complaints-table tbody td strong {
    color: #667eea;
    font-weight: 700;
}

/* View Button in Table */
.btn-view-complaint {
    padding: 8px 18px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3) !important;
    display: inline-block !important;
    min-width: 80px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.btn-view-complaint:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.btn-view-complaint:active {
    transform: translateY(0) !important;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 12px !important;
}

/* Action column alignment */
.complaints-table tbody td:last-child,
.complaints-table thead th:last-child {
    text-align: center !important;
    white-space: nowrap !important;
}

/* Status Badge in Table */
.complaints-table .status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mobile Responsive for Table */
@media (max-width: 768px) {
    .complaints-table {
        font-size: 12px;
    }
    
    .complaints-table thead th,
    .complaints-table tbody td {
        padding: 10px 8px;
    }
    
    .btn-view-complaint {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .regno-results-section {
        padding: 15px;
    }
    
    .regno-results-section h3 {
        font-size: 16px;
    }
    
    .search-type-toggle {
        flex-direction: column;
        gap: 8px;
    }
}

/* File Upload Styles */
.file-upload-wrapper {
    position: relative;
    margin-top: 8px;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 50px;
}

.file-upload-display:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    color: #6c757d;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 3;
    position: relative;
}

.btn-remove-file:hover {
    background: #c82333;
    transform: scale(1.1);
}

.optional-label {
    color: #6c757d;
    font-weight: normal;
    font-size: 12px;
}

/* File upload section - hidden by default, shown only for resubmit/file_reupload status */
#file-upload-group,
#file-upload-group.form-group,
.form-grid > #file-upload-group {
    display: none !important;
}

/* When shown via JavaScript (slideDown), allow display */
#file-upload-group[style*="display: block"],
#file-upload-group[style*="display: flex"] {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 200px;
        transform: translateY(0);
    }
}

/* Student Side - View Attached File Button */
.btn-view-attached-file,
#display_attached_file {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.btn-view-attached-file:hover,
#display_attached_file:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.btn-view-attached-file:disabled,
#display_attached_file:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

#display_attached_file_container {
    margin-top: 10px;
    padding: 12px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
}





/* Professional Header Design */
/* Professional Header Animations */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatLogo {
    0% { transform: translateY(0px) rotate(0deg); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
    50% { transform: translateY(-6px) rotate(3deg); box-shadow: 0 20px 30px rgba(0,0,0,0.3); }
    100% { transform: translateY(0px) rotate(0deg); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
}

@keyframes titleSlideIn {
    0% { opacity: 0; transform: translateX(-20px); filter: blur(5px); }
    100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes badgePop {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); }
    60% { transform: scale(1.05) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Professional Header Design */
.complaint-hero {
    background: linear-gradient(-45deg, #4a00e0, #7b1fa2, #8e2de2, #303f9f); /* Animated Gradient */
    background-size: 300% 300%;
    animation: gradientBG 10s ease infinite;
    color: white;
    padding: 35px 45px;
    border-radius: 20px;
    margin-bottom: 35px;
    box-shadow: 0 20px 40px rgba(74, 0, 224, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Glass effect overlay */
.complaint-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    transform: rotate(30deg);
}

.header-content-wrapper {
    display: flex;
    align-items: center;
    gap: 25px;
    z-index: 2;
    flex-wrap: wrap;
}

.du-logo-placeholder {
    width: 85px;
    height: 85px;
    min-width: 85px;
    min-height: 85px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 4px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    animation: floatLogo 6s ease-in-out infinite;
}

.du-logo-text {
    font-size: 30px;
    font-weight: 900;
    background: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.header-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Main Title Animation & Style consolidated at end */

.sub-title {
    font-size: 19px;
    font-weight: 500;
    margin: 5px 0 0 0;
    opacity: 0;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    animation: titleSlideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards; /* Slight stagger */
}

.portal-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: badgePop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards; /* Elastic Pop */
}

.portal-badge:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    cursor: default;
}


.portal-badge span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Responsive Design for Header */
@media (max-width: 991px) {
    .complaint-hero {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
        gap: 20px;
        height: auto !important;
    }

    .header-content-wrapper {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        justify-content: center;
    }

    .du-logo-placeholder {
        width: 70px;
        height: 70px;
        min-width: 70px;
        min-height: 70px;
        margin: 0 auto; /* Center logo */
    }
    
    .du-logo-text {
        font-size: 24px;
    }

    .main-title {
        font-size: 24px;
        line-height: 1.2;
    }

    .sub-title {
        font-size: 14px;
        letter-spacing: 1.5px;
    }

    .portal-badge {
        width: auto;
        justify-content: center;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .complaint-hero {
        padding: 25px 15px;
        border-radius: 12px;
    }

    .main-title {
        font-size: 20px;
    }
    
    .sub-title {
        font-size: 12px;
    }
}

/* Consolidated Footer Section - Better Polish Design */
.complaint-footer {
    text-align: center;
    margin: 40px auto 20px;
    padding: 25px 30px;
    max-width: 900px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    color: #64748b;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.complaint-footer:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.82);
}

.complaint-footer p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.complaint-footer strong {
    color: #4a00e0;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(74, 0, 224, 0.05);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.complaint-footer strong:hover {
    color: #ffffff;
    background: #4a00e0;
    transform: scale(1.05);
}

/* Moving Shine on Hero */
@keyframes heroShine {
    0% { left: -100%; top: -100%; }
    100% { left: 100%; top: 100%; }
}

.complaint-hero::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    top: 0;
    left: -100%;
    animation: heroShine 5s infinite;
    pointer-events: none;
}

@keyframes textShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Polished Title Shimmer */
.main-title {
    font-size: 34px;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 40%, rgba(255,255,255,0.7) 48%, #ffffff 56%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    letter-spacing: 1px;
    line-height: 1.1;
    text-transform: uppercase;
    animation: titleSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               textShimmer 4s linear infinite;
}

/* ============================================
   Student Chat Section
   ============================================ */
#student-chat-section {
    margin-top: 35px;
    border-top: 2px dashed #e2e8f0;
    padding-top: 25px;
    animation: fadeIn 0.5s ease;
}

.chat-header {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

#student-chat-closed-msg {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
    margin-top: 15px;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
}

#student_chat_container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.chat-input-box {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100% !important;
}

#student_chat_input {
    flex: 1 !important;
    min-width: 0; /* Important for flex-shrink */
    height: 48px !important;
    border-radius: 10px !important;
    border: 2px solid #e2e8f0 !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
    transition: all 0.3s ease;
}

#student_chat_input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

#btn-student-send-chat {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    border: none !important;
    height: 48px !important;
    padding: 0 25px !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2) !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

#btn-student-send-chat:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3) !important;
}

/* Chat Bubbles */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: messageIn 0.3s ease;
}

.chat-message.student {
    align-self: flex-end;
    background: #eef2ff;
    color: #3730a3;
    border-bottom-right-radius: 2px;
    border: 1px solid #e0e7ff;
}

.chat-message.admin {
    align-self: flex-start;
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 2px;
    border: 1px solid #e5e7eb;
}

.message-meta {
    font-size: 10px;
    margin-bottom: 4px;
    font-weight: 600;
    opacity: 0.7;
}

.message-time {
    font-size: 9px;
    margin-top: 4px;
    text-align: right;
    display: block;
    opacity: 0.6;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Adjustments for Chat */
@media (max-width: 768px) {
    #student_chat_container {
        height: 250px;
        padding: 12px;
    }
    
    .chat-input-box {
        display: flex !important;
        flex-direction: row !important; /* Force row layout even on mobile */
        gap: 8px;
        width: 100% !important;
    }
    
    /* Override global mobile width forcing */
    #student_chat_input {
        flex: 1 !important;
        width: auto !important; /* Critical: stop it from being 100% */
        font-size: 15px !important;
        min-width: 0 !important;
        height: 48px !important;
    }
    
    #btn-student-send-chat {
        width: 60px !important; /* Compact button for mobile icon */
        min-width: 60px !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        height: 48px !important;
    }
    
    #btn-student-send-chat span {
        display: none !important;
    }
    
    #btn-student-send-chat::after {
        content: '➤';
        font-size: 22px;
        margin-left: 2px;
    }
}
