/* ==========================================================================
   Protected Area Plugin – Modern Frontend Stylesheet
   ==========================================================================

   Color Palette:
   --bg-gradient:  Deep navy → royal blue gradient
   --glass:       Frosted glass effect for cards
   --accent:      Vibrant indigo/violet for buttons & highlights
   --text:        Crisp white/slate for readability

   ========================================================================== */

/* ----------------------------------------------------------------------- */
/* CSS Reset & Base                                                        */
/* ----------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-grad-1: #0f0c29;
    --bg-grad-2: #302b63;
    --bg-grad-3: #24243e;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);
 --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.7);
    --text-muted: rgba(248, 250, 252, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 50%, var(--bg-grad-3) 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    line-height: 1.6;
}

/* Animated background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #667eea, transparent);
    top: -100px;
    left: -100px;
    animation: floatOrb 20s ease-in-out infinite;
}

body::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #764ba2, transparent);
    bottom: -80px;
    right: -80px;
    animation: floatOrb 25s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(50px, 30px) scale(1.1); }
    66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* ----------------------------------------------------------------------- */
/* Glass Card Container (shared)                                          */
/* ----------------------------------------------------------------------- */

.pa-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    z-index: 1;
    position: relative;
}

/* ----------------------------------------------------------------------- */
/* Login Page                                                              */
/* ----------------------------------------------------------------------- */

.pa-login {
    width: 100%;
    max-width: 440px;
    padding: 3rem 2.5rem;
}

.pa-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.pa-login-logo .pa-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    background: var(--accent-gradient);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    margin-bottom: 1rem;
}

.pa-login-logo .pa-logo-icon svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pa-login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #f8fafc, rgba(248, 250, 252, 0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pa-login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ----------------------------------------------------------------------- */
/* Alerts                                                                  */
/* ----------------------------------------------------------------------- */

.pa-alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideIn 0.35s ease;
}

.pa-alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.pa-alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.pa-alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

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

/* ----------------------------------------------------------------------- */
/* Forms                                                                   */
/* ----------------------------------------------------------------------- */

.pa-form-group {
    margin-bottom: 1.5rem;
}

.pa-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pa-form-group input[type="text"],
.pa-form-group input[type="password"],
.pa-form-group input[type="email"] {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font);
    transition: all var(--transition);
    outline: none;
}

.pa-form-group input::placeholder {
    color: var(--text-muted);
}

.pa-form-group input:focus {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.pa-form-group input:focus {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Checkbox row */
.pa-form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.pa-form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    border-radius: 4px;
}

.pa-form-check label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
}

/* ----------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ----------------------------------------------------------------------- */

.pa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pa-btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.pa-btn-primary:hover {
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.pa-btn-primary:active {
    transform: translateY(0);
}

.pa-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pa-btn-block {
    width: 100%;
}

.pa-btn-outline {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

.pa-btn-outline:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fff;
}

.pa-btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
}

.pa-btn-download {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
}

.pa-btn-download:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* ----------------------------------------------------------------------- */
/* Dashboard                                                               */
/* ----------------------------------------------------------------------- */

.pa-dashboard {
    width: 100%;
    max-width: 900px;
    padding: 2.5rem;
}

/* Dashboard header */
.pa-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.pa-dash-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pa-dash-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.pa-dash-user-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.15rem;
}

.pa-dash-user-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Section title */
.pa-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.pa-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Empty state */
.pa-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.pa-empty-state .pa-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pa-empty-state .pa-empty-icon svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pa-empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.pa-empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* File list table */
.pa-file-list {
    width: 100%;
    border-collapse: collapse;
}

.pa-file-list thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.pa-file-list tbody tr {
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pa-file-list tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pa-file-list tbody td {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pa-file-name {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-primary);
    font-weight: 500;
}

.pa-file-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.pa-file-icon-pdf    { background: rgba(239, 68, 68, 0.15);  color: #fca5a5; }
.pa-file-icon-img    { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.pa-file-icon-doc    { background: rgba(37, 99, 235, 0.15); color: #93c5fd; }
.pa-file-icon-xls    { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.pa-file-icon-zip    { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.pa-file-icon-txt    { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.pa-file-icon-default{ background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

.pa-file-size {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pa-file-date {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.pa-file-actions {
    text-align: right;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------- */
/* Error Page                                                              */
/* ----------------------------------------------------------------------- */

.pa-error {
    text-align: center;
    padding: 3.5rem 3rem;
    max-width: 480px;
}

.pa-error-code {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.pa-error h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.pa-error p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ----------------------------------------------------------------------- */
/* Footer note                                                             */
/* ----------------------------------------------------------------------- */

.pa-footer-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pa-footer-note a{
	color: var(--text-muted);
}

/* ----------------------------------------------------------------------- */
/* Responsive                                                              */
/* ----------------------------------------------------------------------- */

@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .pa-login {
        padding: 2rem 1.5rem;
    }

    .pa-dashboard {
        padding: 1.5rem;
    }

    .pa-dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pa-dash-header > .pa-btn {
        width: 100%;
        justify-content: center;
    }

    /* Stack file table → card layout on mobile */
    .pa-file-list thead {
        display: none;
    }

    .pa-file-list,
    .pa-file-list tbody,
    .pa-file-list tr,
    .pa-file-list td {
        display: block;
        width: 100%;
    }

    .pa-file-list tr {
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-md);
        margin-bottom: 0.75rem;
        padding: 0.5rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .pa-file-list td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
    }

    .pa-file-list td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        font-weight: 600;
    }

    .pa-file-list .pa-file-actions {
        text-align: right;
    }

    .pa-error-code {
        font-size: 3.5rem;
    }
}

@media (max-width: 380px) {
    .pa-login-logo .pa-logo-icon {
        width: 56px;
        height: 56px;
    }

    .pa-login-logo h1 {
        font-size: 1.3rem;
    }
}

/* ----------------------------------------------------------------------- */
/* Animations                                                              */
/* ----------------------------------------------------------------------- */

.pa-fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* Spinner for loading states */
.pa-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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