:root {
    --bg: #0a0a0a;
    --text: #ffffff;
    --subtle: #888888;
    --accent: #00ff9d;
    --accent-dark: #00cc7d;
    --surface: #111111;
    --surface-light: #1a1a1a;
    --border: #222222;
    --gradient: linear-gradient(135deg, var(--accent), #00ffff);
    --card-shadow: 0 8px 32px -8px rgba(0, 255, 157, 0.15);
}

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

body {
    font-family: 'Space Mono', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease;
    text-align: center;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 30px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    font-weight: 700;

}

header p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

header p:nth-child(2) { animation-delay: 0.2s; }
header p:nth-child(3) { animation-delay: 0.4s; }
header p:nth-child(4) { animation-delay: 0.6s; }

header a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

header a:hover {
    opacity: 0.8;
}

em {
    font-style: normal;
    border-bottom: 1px solid var(--text);
}

.upbox {
    margin-bottom: 40px;
}

.drop-zone {
    border: 2px dashed var(--border);
    padding: clamp(30px, 5vh, 60px) 20px;
    border-radius: 24px;
    background: linear-gradient(
        rgba(0, 255, 157, 0.03),
        rgba(0, 255, 157, 0.01)
    );
    backdrop-filter: blur(12px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: linear-gradient(
        rgba(0, 255, 157, 0.08),
        rgba(0, 255, 157, 0.03)
    );
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-content i {
    font-size: 3rem;
    color: var(--accent);
}

.loading-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.dots {
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0;
}

@keyframes loadingDots {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}

.loading-dots .dot:nth-child(1) { animation: loadingDots 1.4s infinite 0s; }
.loading-dots .dot:nth-child(2) { animation: loadingDots 1.4s infinite 0.2s; }
.loading-dots .dot:nth-child(3) { animation: loadingDots 1.4s infinite 0.4s; }

.loading-dots span {
    color: var(--accent);
    font-size: 1rem;
}

.result {
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
}

.tabs {
    display: flex;
    gap: 30px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-light);
    align-items: center;
    animation: fadeInDown 0.5s ease;
}

.tab {
    background: none;
    border: none;
    color: var(--subtle);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 157, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 1;
}

.tab:hover::before {
    width: 300px;
    height: 300px;
}

.tab span {
    position: relative;
    z-index: 2;
}

.tab:hover {
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab.active {
    color: var(--accent);
    background: rgba(0, 255, 157, 0.1);
    font-weight: 600;
    transform: translateY(-2px);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
    animation: glowPulse 2s infinite;
}

.close-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);

    background: var(--surface);
    color: var(--subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.close-btn i {
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.close-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 59, 59, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.close-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ff3b3b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 59, 59, 0.15);
}

.close-btn:hover::before {
    width: 150px;
    height: 150px;
}

.close-btn:hover::after {
    border-color: #ff3b3b;
    transform: scale(1.1);
    opacity: 0;
}

.close-btn:hover i {
    transform: rotate(180deg) scale(1.1);
}

.close-btn:active {
    transform: translateY(0) scale(0.95);
}

@keyframes pulseClose {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 59, 59, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
    }
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.image-side {
    padding: 30px;
    width: 100%;
    max-width: 600px;
}

.image-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.analysis-side {
    padding: 30px;
    border-left: 1px solid var(--border);
}

.content {
    display: none;
    margin-bottom: 30px;
}

.content.active {
    display: block;
}

.content p {
    margin-bottom: 15px;
}

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

.content tr {
    border-bottom: 1px solid var(--border);
}

.content th,
.content td {
    padding: 12px 0;
    text-align: left;
    vertical-align: top;
}

.content th {
    color: var(--subtle);
    width: 140px;
    padding-right: 20px;
    font-weight: normal;
}

.share-section {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    align-items: center;
    background: var(--surface-light);
    animation: fadeInUp 0.5s ease;
}

.share-buttons {
    display: flex;
    gap: 15px;
}

.share-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 157, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.share-btn:hover::before {
    width: 100px;
    height: 100px;
}

.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 255, 157, 0.15);
}

.share-btn i {
    font-size: 1.3rem;
    position: relative;
    z-index: 2;
}

footer {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;

    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo span {
    font-size: 0.9rem;
}

.logo span:first-child {
    color: var(--subtle);
}

.logo .brand {
    color: var(--text);
    position: relative;
    padding-left: 15px;
}

.logo .brand::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 15px;
    background: var(--border);
}

.links {
    display: flex;
    gap: 20px;
}

.links a {
    color: var(--subtle);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.links a:hover {
    color: var(--text);
}

.download-wrapper {
    position: fixed;

    left: -9999px;
    background: #000000;
    width: 1080px;
    height: auto;
    display: none;
}

.download-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    padding: 40px;
    align-items: start;
}

.download-img {
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    border-image: linear-gradient(135deg, var(--accent), #00ffff) 1;
    padding: 15px;
    border-radius: 16px;
}

.download-img img {
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.download-data {
    flex: 1;
    padding: 20px 0;
}

.download-watermark {
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    font-family: 'Space Mono', monospace;
    color: #000000;
    font-size: 18px;
    font-weight: bold;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.watermark-domain {
    font-size: 20px;
}

.watermark-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.watermark-brand .by {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
}

.watermark-brand .name {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;

    letter-spacing: 0.5px;
}

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

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

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

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
    }
}

.hide {
    display: none !important;
}

@media (max-width: 1024px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .image-side {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }
    
    .image-container {
        height: 300px;
    }
    
    .analysis-side {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .wrap {
        padding: 20px;
    }
    
    .tabs {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .share-section {
        padding: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo .brand::before {
        display: none;
    }
    
    .links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .tabs {
        gap: 15px;
    }
    
    .tab {
        font-size: 0.9rem;
    }
    
    .image-container {
        height: 200px;
    }
    
    .image-side {
        padding: 15px;
    }
}

.donate-container {
    display: inline-block;
    position: relative;
    margin-left: 20px;
}

.donate-link {
    font-weight: bold;
}

.server-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff3838;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 100px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
