/*
  ================================================================================
  Vertex Partner Panel - Unified Stylesheet (Admin Mirror)
  Based on Vertex Admin Panel v2.2
  ================================================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

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

/* 
  ================================================================================
  THEME VARIABLES (Identical to Admin)
  ================================================================================
*/
:root {
    /* -- Structure & Text -- */
    --bg-color: #0a0a0a;
    --glass-bg: rgba(26, 26, 26, 0.6);
    --text-color: #f5f5f5;
    --primary-accent: #ffffff;
    --secondary-text: #a3a3a3;
    --input-bg: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.15);
    --disabled-bg: #3f3f46;
    --disabled-text: #71717a;
    --card-bg: rgba(0, 0, 0, 0.2);

    /* -- Semantic Colors -- */
    --error-color: #f43f5e;
    --success-color: #4ade80;
    --info-color: #3b82f6;

    /* -- Badge Colors -- */
    --offline-color: #3b82f6;
    --roleplay-color: #8b5cf6;

    /* -- Animation Particle Color -- */
    --particle-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] {
    /* -- Structure & Text -- */
    --bg-color: #f4f4f5;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --text-color: #1f2937;
    --primary-accent: #111827;
    --secondary-text: #6b7280;
    --input-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --disabled-bg: #e5e7eb;
    --disabled-text: #9ca3af;
    --card-bg: #ffffff;

    /* -- Animation Particle Color -- */
    --particle-color: rgba(0, 0, 0, 0.05);
}

/* 
  ================================================================================
  CORE LAYOUT & TYPOGRAPHY
  ================================================================================
*/
html {
    font-size: 12.8px;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--text-color);
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 1rem 0;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--secondary-text);
    font-weight: 400;
}

h3 {
    text-align: left;
    margin-bottom: 1.5rem;
    color: var(--secondary-text);
    font-weight: 400;
}

h4 {
    margin-top: 0;
    font-weight: 600;
    color: var(--primary-accent);
}

/* Center aligned headings for login and panel */
#login-container h1,
#login-container h2,
.panel-header h2 {
    text-align: center;
}

.panel-header h2 {
    display: inline-block;
    /* Partner badge için */
}

/* 
  ================================================================================
  BACKGROUND ANIMATION (Admin Style)
  ================================================================================
*/
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    margin: 0;
    padding: 0;
}

.bg-animation li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: var(--particle-color);
    animation: animateParticles 20s linear infinite;
    bottom: -200px;
    border-radius: 20%;
}

@keyframes animateParticles {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 20%;
    }

    100% {
        transform: translateY(-120vh) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Particles setup identical to Admin */
.bg-animation li:nth-child(1) {
    left: 10%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.bg-animation li:nth-child(2) {
    left: 20%;
    width: 30px;
    height: 30px;
    animation-delay: 1.5s;
    animation-duration: 10s;
}

.bg-animation li:nth-child(3) {
    left: 25%;
    width: 10px;
    height: 10px;
    animation-delay: 5.5s;
}

.bg-animation li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 15s;
}

.bg-animation li:nth-child(5) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 3.5s;
}

.bg-animation li:nth-child(6) {
    left: 80%;
    width: 120px;
    height: 120px;
    animation-delay: 1s;
}

.bg-animation li:nth-child(7) {
    left: 32%;
    width: 160px;
    height: 160px;
    animation-delay: 7s;
}

.bg-animation li:nth-child(8) {
    left: 55%;
    width: 20px;
    height: 20px;
    animation-delay: 15s;
    animation-duration: 40s;
}

.bg-animation li:nth-child(9) {
    left: 15%;
    width: 15px;
    height: 15px;
    animation-delay: 2s;
    animation-duration: 30s;
}

.bg-animation li:nth-child(10) {
    left: 90%;
    width: 160px;
    height: 160px;
    animation-delay: 4s;
    animation-duration: 9s;
}

/* 
  ================================================================================
  CONTAINERS & PANELS
  ================================================================================
*/
.container {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: fadeIn 0.5s ease-in-out;
    z-index: 1;
}

/* Using ID selector to match Admin specificity */
#partner-panel {
    max-width: 87.5rem;
    /* Matches Admin width */
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    /* Flex layout for internal structure if needed */
    flex-direction: column;
}

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

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

.dashboard-layout {
    display: block;
    /* Partner panel usually single column, but keeps wrapper */
    width: 100%;
}

.dashboard-column {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

html[data-theme="light"] .dashboard-column {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

/* 
  ================================================================================
  FORM ELEMENTS & BUTTONS
  ================================================================================
*/
input,
select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Login Button & General Buttons */
button {
    padding: 14px;
    border: 1px solid var(--primary-accent);
    border-radius: 8px;
    background-color: var(--primary-accent);
    color: var(--bg-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background-color: transparent;
    color: var(--primary-accent);
}

#login-btn {
    width: 100%;
}

/* Secondary Button Style (used for Logout) */
.secondary-btn {
    width: auto;
    background-color: transparent;
    border: 1px solid var(--secondary-text);
    color: var(--secondary-text);
}

.secondary-btn:hover {
    background-color: var(--secondary-text);
    color: var(--bg-color);
    border-color: var(--secondary-text);
}

/* 
  ================================================================================
  HEADER & ACTIONS (Theme Toggle / Logout)
  ================================================================================
*/
.main-header-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

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

.header-actions {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#logout-btn,
#theme-toggle-btn {
    height: 40px;
    border-radius: 12px;
    background-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#logout-btn {
    padding: 0 16px;
    border: 1px solid var(--secondary-text);
    color: var(--secondary-text);
    font-size: 1rem;
}

#logout-btn:hover {
    background-color: var(--primary-accent);
    color: var(--bg-color);
    border-color: var(--primary-accent);
}

#theme-toggle-btn {
    width: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0;
}

#theme-toggle-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background-color: rgba(128, 128, 128, 0.1);
}

#theme-toggle-btn svg {
    position: absolute;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    width: 20px;
    height: 20px;
}

.sun-icon {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

.moon-icon {
    transform: translateY(100%) rotate(-90deg);
    opacity: 0;
}

html[data-theme="light"] .sun-icon {
    transform: translateY(-100%) rotate(90deg);
    opacity: 0;
}

html[data-theme="light"] .moon-icon {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

/* 
  ================================================================================
  PARTNER SPECIFIC: STATS GRID
  Adapted to look like Admin Components
  ================================================================================
*/
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 0;
}

.stat-card {
    background-color: var(--input-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    border-color: var(--secondary-text);
    transform: translateY(-2px);
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-text);
    text-align: center;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-accent);
}

.stat-value.small {
    font-size: 1.2rem;
    font-weight: 500;
}

/* 
  ================================================================================
  PARTNER SPECIFIC: DATA TABLES
  Styled to match Admin Lists
  ================================================================================
*/
.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--input-bg);
    font-size: 0.95rem;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--secondary-text);
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.8rem;
}

html[data-theme="light"] .data-table th {
    background-color: rgba(0, 0, 0, 0.05);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: rgba(128, 128, 128, 0.05);
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--secondary-text);
    font-style: italic;
    background: var(--input-bg);
}

/* 
  ================================================================================
  LOADER (Identical to Admin)
  ================================================================================
*/
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

#app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

#app-loader p {
    color: var(--text-color);
    margin-top: 25px;
    font-size: 1.2rem;
    animation: text-pulse 2s infinite alternate ease-in-out;
}

.loader-logo {
    animation: logo-pulse 2s infinite alternate ease-in-out;
}

.loader-logo .logo-bg {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.loader-logo .logo-line {
    fill: none;
    stroke: var(--primary-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 235;
    stroke-dashoffset: 235;
    animation: draw-line 2.5s ease-in-out forwards;
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes logo-pulse {
    from {
        transform: scale(0.98);
        opacity: 0.8;
    }

    to {
        transform: scale(1.02);
        opacity: 1;
    }
}

@keyframes text-pulse {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* 
  ================================================================================
  TOASTS
  ================================================================================
*/
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.toast {
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 5px solid var(--primary-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

/* 
  ================================================================================
  RESPONSIVE (Admin Matches)
  ================================================================================
*/
@media (max-width: 1024px) {
    #partner-panel {
        max-width: 1400px;
        width: 95%;
    }

    .main-header-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        position: static;
        margin-bottom: 2.5rem;
    }

    .header-actions {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    #partner-panel {
        padding: 1.5rem 1rem;
    }

    .dashboard-column {
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .table-responsive {
        overflow-x: scroll;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }
}