/* ==========================================================================
   Deltio Texnikou CSS - Premium Glassmorphic Light Theme
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-card: rgba(15, 23, 42, 0.08);
    --border-card-focus: rgba(248, 157, 32, 0.5);

    /* Operon brand colours (from public/assets/img/logo.png) */
    --brand-dark: #1d2c34;
    /* "OPERON" blue-grey */
    --primary: #f89d20;
    /* Logo orange: fills, borders, focus. Only 2.1:1 on white, so never small text on white */
    --primary-hover: #e48a10;
    --primary-glow: rgba(248, 157, 32, 0.18);
    --primary-text: #b45309;
    /* Darker orange for text and links on white (readable) */

    --secondary: #fbe50a;
    /* Logo yellow: other end of the logo gradient */
    --secondary-hover: #f5d000;

    --text-main: #1d2c34;
    --text-muted: #64748b;
    /* Slate 500 */
    --text-dark: #1d2c34;

    --success: #059669;
    /* Emerald 600 */
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.15);

    --danger: #dc2626;
    /* Red 600 */
    --danger-bg: rgba(220, 38, 38, 0.08);
    --danger-border: rgba(220, 38, 38, 0.15);

    --font-sans: 'Manrope', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Native checkboxes, radios and range inputs in the brand colour */
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
    accent-color: var(--primary);
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, rgba(248, 157, 32, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(251, 229, 10, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 0.5em;
}

a {
    color: var(--primary-text);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--brand-dark);
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

/* Header & Navigation */
.app-header {
    background: var(--brand-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 32px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
    margin-left: 10px;
}

.user-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.btn-account {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.btn-account:hover,
.btn-account.active {
    color: var(--brand-dark);
    background: var(--primary);
    border-color: var(--primary);
}

.btn-logout:hover {
    color: #ffffff;
    background: rgba(220, 38, 38, 0.9);
    border-color: rgba(220, 38, 38, 0.9);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

/* App Content Area */
.app-content-container {
    flex: 1;
    padding: 40px 0;
}

/* Card Component (Glassmorphism Light) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 15px;
}

/* Forms styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    /* Slate 300 */
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 12px 16px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Form layout helpers */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-row-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--primary);
    color: var(--brand-dark);
    box-shadow: 0 4px 15px rgba(248, 157, 32, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 20px rgba(248, 157, 32, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn:active {
    transform: translateY(1px);
}

/* Centered Form Page (Login & Forgot Password) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: #b45309;
}

.alert-content {
    flex: 1;
}

/* Tables styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th,
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.table th {
    background: rgba(15, 23, 42, 0.02);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    font-size: 0.95rem;
    color: var(--text-main);
}

.table tbody tr:hover {
    background: rgba(15, 23, 42, 0.01);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-admin {
    background: rgba(29, 44, 52, 0.08);
    color: var(--brand-dark);
    border: 1px solid rgba(29, 44, 52, 0.2);
}

.badge-tech {
    background: rgba(248, 157, 32, 0.12);
    color: var(--primary-text);
    border: 1px solid rgba(248, 157, 32, 0.35);
}

/* Wizard / Multi-step Form styling */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 35px;
    position: relative;
    max-width: 100%;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1;
    text-align: center;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: var(--transition);
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 120px;
    transition: var(--transition);
}

.wizard-step.active .step-num {
    border-color: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 0 12px var(--primary-glow);
}

.wizard-step.active .step-label {
    color: var(--text-main);
}

.wizard-step.completed .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--brand-dark);
}

.wizard-step.completed .step-label {
    color: var(--primary-text);
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tickets checkboxes styling */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(15, 23, 42, 0.01);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
}

.ticket-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.ticket-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ticket-item.selected {
    background: rgba(248, 157, 32, 0.08);
    border-color: var(--primary);
}

.ticket-checkbox {
    margin-top: 4px;
}

.ticket-info {
    flex: 1;
}

.ticket-subject {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

.ticket-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Canvas/Signature pad styling */
.signature-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.signature-pad-wrapper {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 500px;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.signature-pad {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 500px;
    margin-top: 10px;
    gap: 10px;
}

/* Loading/Submitting Overlay */
.submit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    color: var(--text-main);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Footer alignment */
.app-footer-brand {
    background: rgba(15, 23, 42, 0.02);
    border-top: 1px solid var(--border-card);
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* AJAX customer loading styles */
.btn-refresh {
    background: none;
    border: none;
    color: var(--primary-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-refresh:hover {
    background: rgba(248, 157, 32, 0.12);
}

.btn-refresh svg {
    transition: transform 0.4s ease;
}

.btn-refresh:hover svg {
    transform: rotate(180deg);
}

.loader-inline {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
    display: none;
}