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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

header h1 span { color: #00d4ff; }

.subtitle {
    color: rgba(255,255,255,0.6);
    margin-top: 0.5rem;
    font-size: 1rem;
}

.shorten-box {
    display: flex;
    gap: 0;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    transition: border-color 0.2s;
}

.shorten-box:focus-within { border-color: #00d4ff; }

.shorten-box input {
    flex: 1;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.shorten-box input::placeholder { color: rgba(255,255,255,0.4); }

.shorten-box button {
    padding: 1rem 1.5rem;
    background: #00d4ff;
    border: none;
    color: #0f0c29;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.shorten-box button:hover { background: #00b8e6; }
.shorten-box button:disabled { opacity: 0.6; cursor: not-allowed; }

.result {
    margin-top: 1.5rem;
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideIn 0.3s ease;
}

.result-url {
    font-size: 1.05rem;
    font-weight: 600;
    color: #00d4ff;
    word-break: break-all;
}

.copy-btn {
    padding: 0.5rem 1.25rem;
    background: #00d4ff;
    border: none;
    border-radius: 8px;
    color: #0f0c29;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.copy-btn:hover { background: #00b8e6; }

.error {
    margin-top: 1rem;
    background: rgba(255,71,87,0.15);
    border: 1px solid rgba(255,71,87,0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #ff6b7a;
    font-size: 0.9rem;
}

.history-section {
    margin-top: 3rem;
}

.history-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.7);
}

.history-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.history-short {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.history-short a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.history-short a:hover { text-decoration: underline; }

.mini-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.mini-copy:hover { opacity: 1; }

.history-original {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty {
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

.clear-btn {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: rgba(255,71,87,0.5);
    color: #ff6b7a;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

footer a:hover { color: #00d4ff; }

.hidden { display: none !important; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15,12,41,0.3);
    border-top-color: #0f0c29;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
    .container { padding: 2rem 1rem; }
    header h1 { font-size: 2rem; }
    .shorten-box { flex-direction: column; }
    .shorten-box button { justify-content: center; }
    .result { flex-direction: column; text-align: center; }
}
