/* local/academic_ticket_system/styles/style.css */

.ats-container {
    font-family: 'Cairo', sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    direction: ltr;
}

.ats-container .hidden {
    display: none !important;
}

/* Ensure container sits above background blobs */
.ats-container #presence-container {
    position: relative;
    z-index: 100;
    display: block;
}

.ats-container .glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ats-container .glass-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.ats-container .glass-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.ats-container .glass-select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1rem;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    width: 100%;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.ats-container .glass-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: rgba(255, 255, 255, 0.9);
}

.ats-container .rating-group {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.5rem;
}

.ats-container .rating-group input {
    display: none;
}

.ats-container .rating-group label {
    cursor: pointer;
    color: #d1d5db;
    font-size: 2rem;
    transition: color 0.2s ease-in-out;
}

.ats-container .rating-group input:checked ~ label {
    color: #f59e0b;
}

.ats-container .rating-group label:hover,
.ats-container .rating-group label:hover ~ label {
    color: #fbbf24;
}

/* Consolidated Presence Wrapper Styles */
.ats-container .presence-wrapper {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 16px;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 999;
}

.ats-container .presence-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.ats-container .pulsing-dot {
    position: relative;
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
}

.ats-container .pulsing-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background-color: #10b981;
    opacity: 0.4;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.ats-container .presence-text {
    font-size: 0.75rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ats-container .presence-avatars {
    display: flex;
    flex-direction: row-reverse;
}

.ats-container .presence-user {
    position: relative;
    margin-left: -12px;
    transition: transform 0.2s ease, z-index 0.2s;
    border-radius: 50%;
    z-index: 1;
    cursor: help;
}

.ats-container .presence-user:hover {
    transform: translateY(-5px) scale(1.1);
    z-index: 10;
}

.ats-container .presence-user img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    object-fit: cover;
}

.ats-container .presence-user::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
}

.ats-container .presence-user:hover::before {
    opacity: 1;
}
/* --- STUDENT DISTINCTION --- */

/* Default Border (For Admin/Support) - White */
.ats-container .presence-user img {
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Owner/Student Border - Gold/Orange */
.ats-container .presence-user.is-owner {
    z-index: 20 !important; /* Make sure student is always on top if stacked */
}

.ats-container .presence-user.is-owner img {
    border: 2px solid #f59e0b; /* Amber-500 */
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3); /* Outer Glow */
}

/* Optional: Add a small star badge for the student */
.ats-container .presence-user.is-owner::after {
    content: '\f007'; /* FontAwesome User Icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #f59e0b;
    color: white;
    font-size: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
}
.ats-container .btn-gradient {
    border: none;
    color: white;
    font-weight: 700;
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.ats-container .btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.ats-container .bg-grad-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.ats-container .bg-grad-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.ats-container .bg-grad-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.ats-container .blob { position: absolute; filter: blur(80px); z-index: 0; opacity: 0.6; animation: float 10s infinite ease-in-out; }
.ats-container .blob-1 { top: 10%; left: 10%; width: 300px; height: 300px; background: #4f46e5; animation-delay: 0s; }
.ats-container .blob-2 { bottom: 20%; right: 10%; width: 350px; height: 350px; background: #ec4899; animation-delay: 2s; }
.ats-container .blob-3 { top: 40%; left: 40%; width: 250px; height: 250px; background: #06b6d4; animation-delay: 4s; }

@keyframes float { 0% { transform: translate(0,0); } 50% { transform: translate(20px,-20px); } 100% { transform: translate(0,0); } }
@keyframes bounce-slight { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ats-container .animate-bounce-slight { animation: bounce-slight 2s infinite; }

[lang="ar"] .ats-container { direction: rtl; }
[lang="ar"] .ats-container .text-right { text-align: right; }
[lang="ar"] .ats-container .text-left { text-align: left; }
[lang="ar"] .ats-container .glass-select { background-position: left 1rem center; }
[lang="ar"] .ats-container .fa-arrow-left { transform: rotate(180deg); }
[lang="ar"] .ats-container .presence-avatars { flex-direction: row-reverse; }
[lang="ar"] .ats-container .presence-user { margin-left: 0; margin-right: -12px; }
[lang="ar"] .ats-container .presence-indicator { margin-right: 0; margin-left: 12px; }

/* --- IMPROVED DISCUSSION HISTORY (Chat Style) --- */

.ats-container .reply-card {
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent; /* تجهيز للحدود */
}

/* 1. STUDENT REPLY (White & Orange) */
.ats-container .reply-card-user {
    background-color: #ffffff;
    border-left: 5px solid #f59e0b; /* Amber-500 */
    border-right: 1px solid rgba(245, 158, 11, 0.1);
    border-top: 1px solid rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.02);
}

/* 2. ADMIN/SUPPORT REPLY (Light Blue & Indented) */
.ats-container .reply-card-admin {
    background-color: #eff6ff; /* Blue-50 (لون سماوي فاتح جداً) */
    border-left: 5px solid #3b82f6; /* Blue-500 */
    border-right: 1px solid rgba(59, 130, 246, 0.1);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.05);

    /* الحركة دي بتخلي رد الدعم داخل لجوه شوية عشان التمييز */
    margin-left: 2rem;
    margin-right: 0;
}

/* RTL Support for Indentation */
[lang="ar"] .ats-container .reply-card-admin {
    margin-left: 0;
    margin-right: 2rem;
    border-left: 1px solid rgba(59, 130, 246, 0.1);
    border-right: 5px solid #3b82f6;
}
[lang="ar"] .ats-container .reply-card-user {
    border-left: 1px solid rgba(245, 158, 11, 0.1);
    border-right: 5px solid #f59e0b;
}

/* تحسين شكل النصوص داخل الكروت */
.ats-container .reply-card-admin .font-bold.text-gray-800 {
    color: #1e40af; /* اسم المشرف باللون الأزرق الغامق */
}

.ats-container .reply-card-user .font-bold.text-gray-800 {
    color: #92400e; /* اسم الطالب باللون البرتقالي الغامق */
}

/* Hover Effect */
.ats-container .reply-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}
/* منطقة الرفع الأساسية */
.ats-container .file-upload-zone {
    position: relative;
    border: 2px dashed #d1d5db;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 1.5rem;
    cursor: pointer;
    overflow: hidden;
}

.ats-container .file-upload-zone:hover {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.8);
}

/* الحالة عند اختيار ملف (زي الصورة اللي بعتها) */
.ats-container .file-upload-zone.files-selected {
    border-color: #10b981; /* اللون الأخضر */
    background: rgba(16, 185, 129, 0.03);
}

.ats-container .upload-icon-wrapper {
    width: 60px;
    height: 60px;
    background: #e0e7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s;
}

.ats-container .files-selected .upload-icon-wrapper {
    background: #d1fae5;
    color: #10b981;
}

/* شكل الملف المختار */
.ats-container .file-item {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ats-container .file-item i {
    color: #10b981;
    font-size: 1.2rem;
}

.ats-container .file-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}