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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 20% 30%, #03050b, #000000);
    min-height: 100vh;
    color: #eef5ff;
    position: relative;
    overflow-x: hidden;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 3s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(1);}
    100% { opacity: 1; transform: scale(1.2);}
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFFFFF, #9aa9ff, #6c47ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    text-shadow: 0 0 15px rgba(108, 71, 255, 0.3);
}

.brand p {
    font-size: 1rem;
    color: #b0c4ff;
    margin-top: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid rgba(108, 71, 255, 0.4);
    overflow: hidden;
}

.stats-header {
    background: rgba(108, 71, 255, 0.2);
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(108, 71, 255, 0.3);
}

.stats-header i {
    margin-right: 0.5rem;
    color: #9b7eff;
}

.stats-content {
    padding: 1.2rem;
    display: flex;
    gap: 1rem;
}

.stats-card .stat-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stats-card .stat-item i {
    font-size: 1.5rem;
    color: #9b7eff;
}

.stats-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stats-card .stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.stats-card .stat-label {
    font-size: 0.65rem;
    color: #aaaaff;
}

/* Upload Zone */
.upload-zone {
    background: rgba(10, 20, 40, 0.55);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(90, 140, 255, 0.3);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.5);
}

.upload-zone:hover {
    border-color: #6c47ff;
    background: rgba(20, 35, 65, 0.65);
    transform: translateY(-3px);
}

.upload-icon {
    font-size: 3.2rem;
    color: #b3c7ff;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.6rem;
    font-weight: 500;
}

.upload-zone span {
    font-size: 0.9rem;
    color: #99a9dd;
}

input[type="file"] {
    display: none;
}

/* Blackhole Loader */
.blackhole-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.blackhole-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blackhole-core {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, #000000, #1a0b2e);
    border-radius: 50%;
    box-shadow: 0 0 20px #6c47ff, inset 0 0 12px rgba(255,255,200,0.3);
    z-index: 2;
    animation: corePulse 1.2s infinite alternate;
}

.accretion-ring {
    position: absolute;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 3px solid #ff66cc;
    border-right: 3px solid #aa55ff;
    border-bottom: 3px solid #3a86ff;
    border-left: 3px solid #ffaa33;
    animation: spin 1.2s linear infinite;
    filter: blur(0.8px);
}

.accretion-ring-second {
    width: 125px;
    height: 125px;
    border-top: 2px solid #ff88aa;
    border-right: 2px solid #ff55aa;
    animation: spinReverse 2s linear infinite;
    filter: blur(1px);
}

.loader-text {
    margin-top: 1.2rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 500;
    background: linear-gradient(45deg, #ccb3ff, #9b7eff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes corePulse {
    0% { transform: scale(1); opacity: 0.9; box-shadow: 0 0 12px #6c47ff; }
    100% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 30px #aa55ff; }
}

/* History Section */
.history-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-left: 4px solid #7b4cff;
    padding-left: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: #ff8888;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
}

.clear-btn:hover {
    background: rgba(255, 100, 100, 0.4);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.history-item {
    background: rgba(12, 18, 34, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(100, 130, 250, 0.25);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.2s;
}

.history-item:hover {
    border-color: #7b4cff;
    background: rgba(30, 40, 65, 0.8);
}

.history-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.history-info {
    flex: 1;
    overflow: hidden;
}

.history-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 0.65rem;
    color: #88aaff;
    display: flex;
    gap: 1rem;
    margin-top: 0.2rem;
}

.history-link {
    font-size: 0.7rem;
    color: #9bbaff;
    text-decoration: none;
    word-break: break-all;
}

.history-link:hover {
    color: white;
    text-decoration: underline;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-copy, .history-delete {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #ccd9ff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
}

.history-copy:hover {
    background: #6c47ff;
    color: white;
}

.history-delete:hover {
    background: #ff4444;
    color: white;
}

.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1f2ccc;
    backdrop-filter: blur(16px);
    padding: 0.8rem 1.8rem;
    border-radius: 60px;
    font-size: 0.85rem;
    border-left: 3px solid #6c47ff;
    color: #eef;
    z-index: 200;
    display: none;
    font-weight: 500;
}

footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #6c47ff;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .brand h1 { font-size: 2.5rem; }
    .upload-zone { padding: 1.5rem; }
    .stats-content { flex-direction: column; }
    .history-item { flex-wrap: wrap; }
    .history-actions { margin-left: auto; }
}
