body, * { font-family: Tahoma, sans-serif; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #555;
    margin: 30px 0 20px 0;
    font-size: 1.5em;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

input[type="text"], input[type="password"] {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

.short-url-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.short-url-container input {
    flex: 1;
}

.short-url-container button {
    padding: 15px 25px;
}

#result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#result p {
    margin-bottom: 10px;
    color: #555;
    font-weight: bold;
}

.admin-link {
    text-align: center;
    margin-top: 30px;
}

.admin-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.admin-link a:hover {
    text-decoration: underline;
}

.recent-links {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.link-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.link-info strong {
    color: #667eea;
    font-size: 1.1em;
}

.original-url {
    color: #666;
    font-size: 0.9em;
}

.link-stats {
    display: flex;
    gap: 15px;
    color: #888;
    font-size: 0.9em;
}

.no-links {
    text-align: center;
    color: #999;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logout-btn {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-box h3 {
    font-size: 1em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #555;
}

tr:hover {
    background: #f8f9fa;
}

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

.btn-stats, .btn-edit, .btn-delete {
    padding: 8px 15px;
    margin: 0 5px;
    font-size: 14px;
}

.btn-stats {
    background: #17a2b8;
}

.btn-edit {
    background: #ffc107;
}

.btn-delete {
    background: #dc3545;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    left: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.stats-detail {
    margin-top: 20px;
}

.stats-detail p {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.stats-detail strong {
    color: #667eea;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}

.btn-new {
    background: linear-gradient(135deg, #28a745, #20c997);
    padding: 12px 25px;
    font-size: 15px;
}

.link-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.btn-copy-small {
    padding: 6px 14px;
    font-size: 13px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-radius: 6px;
    min-width: 70px;
}

.btn-copy-small:disabled {
    background: #28a745;
    transform: none;
    cursor: default;
}

.create-form { background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.create-form h2 { margin-top: 0; font-size: 1.1rem; }
.create-form input { padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-family: Tahoma, sans-serif; font-size: 0.95rem; }
.btn-create { background: #2563eb; color: white; border: none; padding: 9px 20px; border-radius: 6px; cursor: pointer; font-family: Tahoma, sans-serif; }
.result-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-box span { font-weight: bold; color: #2563eb; }
.result-box button { padding: 6px 14px; border-radius: 6px; border: 1px solid #ccc; cursor: pointer; font-family: Tahoma, sans-serif; }

.create-form { background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.create-form h2 { margin-top: 0; font-size: 1.1rem; }
.create-form input { padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-family: Tahoma, sans-serif; font-size: 0.95rem; }
.btn-create { background: #2563eb; color: white; border: none; padding: 9px 20px; border-radius: 6px; cursor: pointer; font-family: Tahoma, sans-serif; }
.result-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-box span { font-weight: bold; color: #2563eb; }
.result-box button { padding: 6px 14px; border-radius: 6px; border: 1px solid #ccc; cursor: pointer; font-family: Tahoma, sans-serif; }

.copy-code {
    cursor: pointer;
    color: #2563eb;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    display: inline-block;
}
.copy-code:hover {
    background: #e0e7ff;
}
.copy-code.copied {
    color: #16a34a;
    background: #dcfce7;
}
