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

:root {
    --primary: #5B5BD6;
    --bg: #f8f9fa;
    --text: #333;
    --border: #ddd;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-right {
    display: flex;
    gap: 1rem;
}

.btn, .btn-small, .btn-small-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn {
    background: var(--primary);
    color: white;
}

.btn:hover {
    background: #4a4ac0;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    background: var(--primary);
    color: white;
}

.btn-small:hover {
    background: #4a4ac0;
}

.btn-small-delete {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    background: var(--danger);
    color: white;
}

.btn-small-delete:hover {
    background: #c82333;
}

.logout-btn {
    background: var(--danger);
    color: white;
}

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

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

.login-container {
    max-width: 400px;
    margin: 5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.1);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.site-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}

.site-card:hover {
    transform: translateY(-2px);
}

.site-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.site-name-link {
    color: var(--primary);
    text-decoration: none;
}

.site-name-link:hover {
    text-decoration: underline;
}

a.logo {
    text-decoration: none;
}

.site-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.timestamp {
    font-size: 0.85rem;
    color: #999;
}

.site-card .btn {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-section h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    background: rgba(91, 91, 214, 0.1);
}

.drop-zone input[type="file"] {
    display: none;
}

.version-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.version-table thead {
    background: #f5f5f5;
    border-bottom: 1px solid var(--border);
}

.version-table th,
.version-table td {
    padding: 1rem;
    text-align: left;
}

.version-table th {
    font-weight: 600;
    color: var(--primary);
}

.version-table tr:hover {
    background: #fafafa;
}

.version-table td:last-child {
    display: flex;
    gap: 0.5rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.site-detail-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.site-detail-header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.site-detail-header p {
    color: #666;
    font-size: 0.95rem;
}

.version-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(91, 91, 214, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}
