:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --secondary: #ff6b35;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1f1f1f;
    --text: #ffffff;
    --text-muted: #a3a3a3;
    --text-dim: #737373;
    --border: #262626;
    --border-light: #3a3a3a;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-lg: rgba(0, 0, 0, 0.7);
    --glow: rgba(249, 115, 22, 0.15);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    z-index: 1;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px var(--shadow-lg);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 12px 40px var(--shadow-lg);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

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

.input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15), 0 4px 12px rgba(249, 115, 22, 0.1);
    background: var(--bg-card);
}

.label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.grid {
    display: grid;
    gap: 1.5rem;
}

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

.flex {
    display: flex;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

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

.text-muted {
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

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

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.close-btn:hover {
    color: var(--text);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.sidebar-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg-card);
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

::-webkit-scrollbar-corner {
    background: var(--bg-card);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-card);
}

.profile-item {
    transition: all 0.2s ease;
}

.profile-item:hover {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
    transform: translateX(4px);
}

.license-wrapper-3d {
    perspective: 2000px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    min-height: 500px;
}

.cyber-license-card {
    position: relative;
    width: 680px;
    max-width: 100%;
    height: 420px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 24px;
    box-shadow: 
        0 0 0 2px rgba(249, 115, 22, 0.3),
        0 0 40px rgba(249, 115, 22, 0.2),
        0 30px 80px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: grid;
    grid-template-columns: 240px 1fr;
    font-family: 'Poppins', sans-serif;
    color: white;
    transform-style: preserve-3d;
    animation: card-entrance-epic 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

@keyframes card-entrance-epic {
    0% {
        transform: rotateY(-180deg) rotateX(20deg) scale(0.3) translateZ(-200px);
        opacity: 0;
        filter: blur(20px);
    }
    50% {
        transform: rotateY(-90deg) rotateX(10deg) scale(0.9) translateZ(0);
        opacity: 0.7;
        filter: blur(5px);
    }
    80% {
        transform: rotateY(0deg) rotateX(0deg) scale(1) translateZ(0);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: rotateY(0deg) rotateX(0deg) scale(1) translateZ(0);
        opacity: 1;
        filter: blur(0);
    }
}

.cyber-license-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), rgba(249, 115, 22, 0.1), rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    animation: hologram-shine 4s infinite linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes hologram-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.clc-sidebar {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 50%, rgba(0,0,0,0.3) 100%);
    border-right: 2px solid rgba(249, 115, 22, 0.4);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    position: relative;
    animation: sidebar-fade-in 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes sidebar-fade-in {
    to { opacity: 1; }
}

.clc-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.4) 0%, transparent 100%);
    border-radius: 24px 0 0 0;
}

.clc-photo-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark), #ff6b35);
    box-shadow: 
        0 0 30px rgba(249, 115, 22, 0.6),
        0 0 60px rgba(249, 115, 22, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: photo-glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}

@keyframes photo-glow {
    0% {
        box-shadow: 
            0 0 30px rgba(249, 115, 22, 0.6),
            0 0 60px rgba(249, 115, 22, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 
            0 0 40px rgba(249, 115, 22, 0.8),
            0 0 80px rgba(249, 115, 22, 0.5),
            inset 0 0 20px rgba(255, 255, 255, 0.15);
    }
}

.clc-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #0f3460;
    background: #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.clc-chip {
    width: 50px;
    height: 35px;
    background: linear-gradient(135deg, #e1b12c, #fbc531);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
    margin-top: auto;
    align-self: flex-start;
}

.clc-chip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 70%;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
}

.clc-content {
    padding: 30px 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    animation: content-fade-in 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes content-fade-in {
    to { opacity: 1; }
}

.clc-header {
    border-bottom: 3px solid rgba(249, 115, 22, 0.3);
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
}

.clc-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--primary);
    animation: header-line 0.6s ease-out 0.8s forwards;
    transform: scaleX(0);
    transform-origin: left;
}

@keyframes header-line {
    to { transform: scaleX(1); }
}

.clc-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clc-subtitle {
    font-size: 0.75rem;
    color: var(--primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.clc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.clc-field {
    display: flex;
    flex-direction: column;
}

.clc-label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.clc-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.clc-value.highlight {
    color: var(--primary);
}

.clc-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 15px;
}

.clc-qr-wrapper {
    background: white;
    padding: 6px;
    border-radius: 8px;
    height: 70px;
    width: 70px;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.clc-qr-wrapper img {
    width: 100%;
    height: 100%;
}

.clc-stamp-container {
    position: relative;
    width: 120px;
    height: 120px;
    overflow: visible;
}

.clc-stamp-result {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    opacity: 0;
    z-index: 1;
    animation: stamp-print-appear 0.4s ease-out 2.8s forwards;
}

.clc-stamp-print {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: 
        sepia(30%) 
        contrast(1.3) 
        brightness(0.85)
        drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
    transform: rotate(-8deg);
    opacity: 0.9;
}

.clc-stamp-tool {
    position: absolute;
    top: -150px;
    right: -50px;
    width: 100px;
    height: 150px;
    z-index: 200;
    animation: stamp-approach 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1.8s forwards;
    opacity: 0;
    transform-origin: bottom center;
}

.clc-stamp-handle {
    width: 20px;
    height: 80px;
    background: linear-gradient(180deg, #8b7355 0%, #6b5d4f 100%);
    border-radius: 10px 10px 4px 4px;
    margin: 0 auto;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.clc-stamp-handle::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.clc-stamp-base {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #c9a961 0%, #b8945f 50%, #a67c52 100%);
    border-radius: 50%;
    margin: -10px auto 0;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.clc-stamp-base::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.clc-stamp-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
    z-index: 3;
    position: relative;
}

@keyframes stamp-approach {
    0% {
        opacity: 0;
        transform: translateX(200px) translateY(0) rotate(45deg) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translateX(50px) translateY(-20px) rotate(15deg) scale(1);
    }
    60% {
        transform: translateX(0) translateY(0) rotate(-5deg) scale(1.05);
    }
    75% {
        transform: translateX(-5px) translateY(5px) rotate(-8deg) scale(1);
    }
    85% {
        transform: translateX(-2px) translateY(2px) rotate(-8deg) scale(0.98);
    }
    90% {
        opacity: 1;
        transform: translateX(0) translateY(0) rotate(-8deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-8deg) scale(1);
    }
}

@keyframes stamp-print-appear {
    0% {
        opacity: 0;
        transform: rotate(-8deg) scale(0.5);
        filter: 
            sepia(30%) 
            contrast(1.3) 
            brightness(0.85)
            drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5))
            blur(5px);
    }
    50% {
        transform: rotate(-8deg) scale(1.1);
        filter: 
            sepia(30%) 
            contrast(1.3) 
            brightness(0.85)
            drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5))
            blur(2px);
    }
    100% {
        opacity: 0.9;
        transform: rotate(-8deg) scale(1);
        filter: 
            sepia(30%) 
            contrast(1.3) 
            brightness(0.85)
            drop-shadow(0 3px 10px rgba(0, 0, 0, 0, 0.5))
            blur(0);
    }
}

@media (max-width: 700px) {
    .cyber-license-card {
        grid-template-columns: 1fr;
        height: auto;
        width: 100%;
    }
    .clc-sidebar {
        flex-direction: row;
        padding: 15px;
    }
    .clc-photo-container {
        width: 80px;
        height: 80px;
    }
    .clc-chip {
        display: none;
    }
}

@media (max-width: 1024px) {
    #sidebar-container {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #sidebar-container.mobile-sidebar-open {
        transform: translateX(0);
    }
    
    #app > div > div:nth-child(2),
    #app > div > div[style*="margin-left"],
    #app > div > div[style*="280px"] {
        margin-left: 0 !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 101;
        width: 48px;
        height: 48px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text);
        font-size: 1.25rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 99;
        backdrop-filter: blur(4px);
    }
    
    .mobile-sidebar-overlay.active {
        display: block;
    }
    
    .card {
        padding: 1.25rem !important;
    }
    
    .container {
        padding: 1rem;
    }
    
    #app > div {
        position: relative;
        overflow-x: hidden;
    }
    
    #app > div > div[style*="margin-left: 280px"] {
        box-sizing: border-box;
        max-width: 100vw;
    }
    
    .mobile-menu-close {
        display: block !important;
    }
    
    * {
        max-width: 100vw;
    }
    
    #app {
        overflow-x: hidden;
        width: 100%;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr !important;
    }
    
    #app > div > div:nth-child(2) > div:first-child,
    #app > div > div[style*="margin-left"] > div:first-child,
    #app > div > div > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    #app > div > div:nth-child(2) > div:first-child > div:last-child,
    #app > div > div[style*="margin-left"] > div:first-child > div:last-child,
    #app > div > div > div:first-child > div:last-child {
        width: 100% !important;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    #app > div > div:nth-child(2),
    #app > div > div[style*="margin-left"],
    #app > div > div[style*="280px"] {
        padding: 0.75rem !important;
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .card {
        padding: 1rem !important;
        border-radius: 12px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .modal {
        width: 95% !important;
        padding: 1.5rem !important;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}
