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

:root {
    --bg-color: #0f0c29;
    --surface-color: #1a1a2e;
    --text-color: #eaeaea;
    --text-muted: #a0a0b0;
    --primary-color: #6c63ff;
    --primary-hover: #5a52d5;
    --border-color: #2e2e4d;
    --input-bg: #252540;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --radius-md: 16px;
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --border-color: #e5e7eb;
    --input-bg: #f9fafb;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    z-index: 100;
    text-align: center;
}

.app-header h1 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    padding-top: 80px;
}

h2,
h3 {
    margin-bottom: 20px;
    font-weight: 600;
}

h2 {
    font-size: clamp(1.5rem, 8vw, 2rem);
    color: var(--primary-color);
    text-align: center;
}

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

a:hover {
    color: var(--primary-hover);
}

.logout-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.logout-link:hover {
    color: var(--text-color);
}

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

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

.box,
form,
.table-container,
.chart-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: clamp(15px, 5vw, 30px);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    animation: fadeInUp 0.5s ease-out forwards;
}

.table-container {
    max-width: 100%;
    overflow-x: auto;
}

.box:nth-child(1) {
    animation-delay: 0.1s;
}

form:nth-child(2) {
    animation-delay: 0.2s;
}

.chart-container {
    animation-delay: 0.3s;
}

.table-container {
    animation-delay: 0.4s;
}

.chart-container {
    position: relative;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 5px;
    display: inline-block;
    color: white;
    transition: transform 0.1s, opacity 0.2s;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out forwards;
    padding: 0 10px;
}

.hero h1 {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary-lg,
.btn-secondary-lg {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.btn-primary-lg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn-primary-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
}

.btn-secondary-lg {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary-lg:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

button,
.nav-button {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 6px rgba(108, 99, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

button:hover,
.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(108, 99, 255, 0.4);
}

.btn-edit {
    background-color: var(--primary-color);
}

.btn-delete {
    background-color: #ef4444;
}

input,
select {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 20px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.2);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.decor-item {
    position: absolute;
    opacity: 0.15;
    fill: var(--primary-color);
    transition: transform 0.1s ease-out;
}

.decor-item:nth-child(1) {
    top: 10%;
    left: 5%;
    width: 40px;
}

.decor-item:nth-child(2) {
    top: 15%;
    right: 5%;
    width: 60px;
}

.decor-item:nth-child(3) {
    bottom: 10%;
    left: 10%;
    width: 40px;
}

.decor-item:nth-child(4) {
    bottom: 20%;
    right: 5%;
    width: 50px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.3s ease-out;
}

.modal-header {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.modal-btn-primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn-secondary {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@media (min-width: 600px) {
    .toast-notification {
        left: auto;
        right: 20px;
        margin: 0;
    }
}

.toast-notification.active {
    display: block;
}

.toast-notification.success {
    border-left: 4px solid #10b981;
}

.toast-notification.error {
    border-left: 4px solid #ef4444;
}

.toast-notification.info {
    border-left: 4px solid var(--primary-color);
}

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

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

@media (max-width: 768px) {
    .hero-decorations {
        display: none;
    }

    .page-container {
        padding-top: 60px;
    }

    .box,
    form,
    .chart-container,
    .table-container {
        max-width: 100%;
    }
}