/* =============================
   ASTROX ADMIN DASHBOARD STYLE
   Modern UI/UX Design 2025
   ============================= */

/* ---- RESET ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---- ROOT THEME VARIABLES ---- */
:root {
    --bg-main: #0a0e1a;
    --bg-card: rgba(20, 25, 40, 0.85);
    --bg-input: rgba(255, 255, 255, 0.08);
    --accent: #00d4ff;
    --accent-hover: #00a8cc;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --success: #00ff88;
    --danger: #ff3366;
    --warning: #ffaa00;
    --text-primary: #f0f4f8;
    --text-secondary: #9ca3af;
    --border: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 48px rgba(0, 212, 255, 0.25);
}

/* ---- BODY ---- */
body {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0a0e1a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
    z-index: -1;
}

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

/* ---- HEADER ---- */
header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 1.25rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
    animation: slideDown 0.6s ease;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    transition: var(--transition);
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ---- MAIN ---- */
main {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease;
}

/* ---- CONTAINERS ---- */
.glass, .login-container, .user-management, .reply-form {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease;
    transition: var(--transition);
}

.glass:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-hover);
}

/* ---- HEADINGS ---- */
h2, h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--accent), #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.4rem;
}

/* ---- LOGIN CONTAINER ---- */
.login-container {
    width: 100%;
    max-width: 450px;
    margin: 8vh auto;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 2rem;
}

/* ---- FORM ELEMENTS ---- */
form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

label {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: -0.5rem;
}

input, select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    outline: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(0, 212, 255, 0.05);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ---- BUTTONS ---- */
button, .button, a.button {
    background: linear-gradient(135deg, var(--accent), #00a8cc);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

button::before, .button::before, a.button::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;
}

button:hover::before, .button:hover::before, a.button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover, .button:hover, a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

button:active, .button:active, a.button:active {
    transform: translateY(0);
}

.close-button {
    background: linear-gradient(135deg, var(--danger), #cc0033);
    color: #fff;
}

.close-button:hover {
    box-shadow: 0 8px 24px rgba(255, 51, 102, 0.4);
}

/* ---- TABLES ---- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

thead {
    background: linear-gradient(135deg, var(--accent), #00a8cc);
    color: #000;
}

th {
    padding: 1.1rem 1.2rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.2rem;
    text-align: left;
}

tbody tr {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(0, 212, 255, 0.08);
    transform: scale(1.01);
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-open {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-closed {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.ticket-closed {
    opacity: 0.6;
}

/* ---- TABLE BUTTONS ---- */
table button, table a.button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin: 0.2rem;
}

.view-button {
    background: linear-gradient(135deg, var(--accent), #00a8cc);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.view-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.back-button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: 1px solid var(--border);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

/* ---- MESSAGES ---- */
.message, .error {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideIn 0.4s ease;
}

.message.success {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.error {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ---- CHAT MESSAGES ---- */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.message-bubble {
    padding: 1.2rem;
    border-radius: var(--radius);
    max-width: 75%;
    animation: fadeInUp 0.4s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.message-bubble.user {
    align-self: flex-start;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid var(--accent);
}

.message-bubble.team {
    align-self: flex-end;
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid var(--success);
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- FORM ACTIONS ---- */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    header, main {
        width: 95%;
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav {
        justify-content: center;
        gap: 0.5rem;
    }

    nav a {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.8rem;
    }

    .glass, .login-container {
        padding: 1.5rem;
    }

    .login-container {
        margin-top: 5vh;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }
}

/* ---- UTILITY CLASSES ---- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-1 {
    gap: 1rem;
}
