:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #22c55e;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #db2777;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

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

/* Layout */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 50px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.conn-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-top: 15px;
    gap: 10px;
    font-size: 0.85rem;
    animation: fadeUp 0.8s ease 0.2s both;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
    transition: all 0.3s ease;
}

.status-text {
    font-weight: 500;
}

.retry-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* Sections */
.section {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section.hidden {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Proctor Grid */
.proctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    min-height: 200px; /* Prevent collapse */
}

.proctor-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeUp 0.6s ease both; /* Changed backwards to both for reliability */
}

.proctor-card:nth-child(1) { animation-delay: 0.1s; }
.proctor-card:nth-child(2) { animation-delay: 0.2s; }
.proctor-card:nth-child(3) { animation-delay: 0.3s; }

.proctor-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.proctor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    border: 3px solid var(--glass-border);
}

.proctor-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.proctor-dept {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.select-btn {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.proctor-card:hover .select-btn {
    background: var(--primary);
    color: white;
}

/* Feedback Form Card */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.form-card {
    border-radius: 24px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 30px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: white;
}

.selected-proctor-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
    100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.5); }
}

.proctor-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    animation: glow 2s infinite alternate;
}

/* Form Styling */
.form-group-container {
    margin-bottom: 40px;
    animation: fadeUp 0.8s ease backwards;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-msg {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.form-group-container h4 {
    font-size: 1.1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rating-questions {
    display: grid;
    gap: 15px;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.rating-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.rating-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-value-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
    font-weight: 500;
}

.rating-item label {
    font-size: 0.95rem;
    flex: 1;
}

.stars {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 1.5rem;
    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
}

.star.active, .star:hover {
    color: #fbbf24;
    transform: scale(1.2);
}

.star.active {
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* Input Fields */
.input-group {
    margin-bottom: 25px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

.input-group label {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    flex: 1;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
}

/* Buttons */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

/* Success Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.success-card {
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    font-size: 40px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 30px;
}

.primary-btn {
    padding: 12px 30px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    margin-top: 30px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .rating-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
}
