/* css Reset and Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e1e2f;
    --light: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;

    /* Modern Glass Constants */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    /* Dynamic Animated Gradient Background */
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    color: var(--text-main);
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Base Glassmorphism Class */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

/* Subtle inner shine */
.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    z-index: 1;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    text-align: center;
    margin-bottom: 50px;
}

.sidebar h2 {
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar h2 i {
    color: var(--secondary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.sidebar ul {
    list-style: none;
    flex: 1;
}

.sidebar ul li {
    margin-bottom: 15px;
    opacity: 0;
    transform: translateX(-20px);
    animation: staggerInLeft 0.5s forwards;
}

.sidebar ul li:nth-child(1) {
    animation-delay: 0.1s;
}

.sidebar ul li:nth-child(2) {
    animation-delay: 0.2s;
}

.sidebar ul li:nth-child(3) {
    animation-delay: 0.3s;
}

.sidebar ul li:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes staggerInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar ul li a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    z-index: 0;
}

.sidebar ul li a:hover::after,
.sidebar ul li a.active::after {
    transform: translateX(0);
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transform: translateX(5px);
}

.sidebar ul li a i {
    font-size: 1.1em;
    z-index: 1;
}

.sidebar ul li a span {
    z-index: 1;
}

.creator-info {
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: var(--text-muted);
}

.creator-info span {
    font-weight: 600;
    color: var(--primary-dark);
    display: block;
    margin-top: 4px;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
    letter-spacing: -1px;
}

header p.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-top: 5px;
    font-weight: 400;
}

/* Flash Messages Animation */
.messages {
    position: fixed;
    top: 30px;
    right: 40px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.alert {
    padding: 18px 24px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, fadeOut 0.5s ease 4s forwards;
}

.alert i {
    font-size: 20px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
    }
}

.alert.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Beautiful Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) rotate(45deg) translateY(100%);
    transition: transform 0.6s ease;
}

.btn:hover::before {
    transform: translate(-50%, -50%) rotate(45deg) translateY(-100%);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #be123c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
}

/* Dashboard Metrics */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.card {
    padding: 35px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s forwards;
}

.dashboard-cards .card:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-cards .card:nth-child(2) {
    animation-delay: 0.2s;
}

.dashboard-cards .card:nth-child(3) {
    animation-delay: 0.3s;
}

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

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
    height: 80px;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.card .big-num {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.alert-card .card-icon {
    color: var(--warning);
}

.alert-card .big-num {
    background: linear-gradient(135deg, var(--danger), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stunning Dashboard Table */
.recent-sales,
.table-container {
    padding: 35px;
    animation: fadeInUp 0.6s forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.recent-sales h2,
.table-container h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-sales h2 i,
.table-container h2 i {
    color: var(--primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 18px 24px;
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: default;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.low-stock .badge {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

td.price {
    font-family: monospace;
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-dark);
}

/* Beautiful Forms */
.form-container {
    padding: 45px;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
    animation-delay: 0.1s;
}

.form-container h2 {
    margin-bottom: 35px;
    text-align: center;
    color: var(--dark);
    font-size: 28px;
    font-weight: 700;
}

.form-row {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    position: relative;
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: var(--primary);
}

input,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.4);
    font-family: inherit;
    font-size: 15px;
    color: var(--dark);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

input::placeholder,
select::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

input:hover,
select:hover {
    background: rgba(255, 255, 255, 0.6);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.form-container .btn {
    width: 100%;
    margin-top: 20px;
    padding: 18px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animations for Focus Fields */
input:focus+.input-border,
select:focus+.input-border {
    width: 100%;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--primary);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 20px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    .sidebar ul {
        display: flex;
        gap: 10px;
        margin-bottom: 0;
    }

    .sidebar ul li {
        margin-bottom: 0;
        animation: none;
        opacity: 1;
        transform: none;
    }

    .sidebar ul li a span {
        display: none;
    }

    .sidebar ul li a {
        padding: 12px;
    }

    .main-content {
        padding: 20px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .creator-info {
        display: none;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}