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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

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

header h1 {
    font-size: 1.8rem;
    color: #111;
}

header .subtitle {
    color: #666;
    font-size: 0.95rem;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #222;
}

/* Create Form */
.create-form {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.form-group .optional {
    font-weight: 400;
    color: #999;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90d9;
}

button[type="submit"] {
    background: #4a90d9;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #357abd;
}

button[type="submit"]:disabled {
    background: #a0c4e8;
    cursor: not-allowed;
}

.result {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.result.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.result.error {
    background: #fce4ec;
    color: #c62828;
}

.hidden {
    display: none;
}

/* Links Table */
.links-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#links-table-wrapper {
    overflow-x: auto;
}

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

thead th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid #eee;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fafafa;
}

.short-url-cell {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.short-url-cell a {
    color: #4a90d9;
    text-decoration: none;
}

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

.long-url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
}

.clicks-cell {
    text-align: center;
    font-weight: 600;
    color: #4a90d9;
}

.date-cell {
    white-space: nowrap;
    color: #888;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 2rem !important;
}

/* Buttons */
.copy-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    color: #666;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: #4a90d9;
    color: #4a90d9;
}

.copy-btn.copied {
    border-color: #2e7d32;
    color: #2e7d32;
}

.delete-btn {
    background: none;
    border: 1px solid #e57373;
    color: #e57373;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #e57373;
    color: #fff;
}

/* Login form */
.login-form {
    max-width: 400px;
    margin: 2rem auto;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .long-url-cell {
        max-width: 150px;
    }
}
