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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #667eea;
}

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

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
    text-align: center;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: #28a745;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
}

.success-message.show {
    display: block;
}

/* Admin Container */
.admin-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.admin-header h2 {
    color: #667eea;
}

.party-section {
    margin-bottom: 2rem;
}

.party-section h3 {
    margin-bottom: 1rem;
    color: #555;
}

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

.party-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.party-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.party-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.party-table tbody tr:hover {
    background: #f8f9ff;
}

.party-table tbody tr:last-child td {
    border-bottom: none;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f0f0f0;
}

.autocomplete-item.selected {
    background: #667eea;
    color: white;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Distribution Section */
.distribution-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

/* Player Stats Section */
.player-stats-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.player-stats-section h3 {
    margin-bottom: 1rem;
    color: #555;
}

.player-stats-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.player-stats-controls label {
    font-weight: 500;
    color: #555;
}

.player-select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.player-select:focus {
    outline: none;
    border-color: #667eea;
}

.player-stats-display {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.player-stats-display h4 {
    margin-bottom: 1rem;
    color: #667eea;
    font-size: 1.2rem;
}

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

.stats-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    color: #555;
    width: 40%;
}

.stats-table td {
    padding: 0.75rem;
    color: #333;
    font-size: 1.1rem;
}

.stats-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.stats-table tr:last-child {
    border-bottom: none;
}

.player-stats-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.player-stats-display .error-message,
.player-stats-display .success-message {
    margin-top: 1rem;
}

/* PIN Section */
.pin-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.pin-section h3 {
    margin-bottom: 1rem;
    color: #555;
}

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

.pin-section .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.pin-section .form-group input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.pin-section .form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.distribution-section h3 {
    margin-bottom: 1rem;
    color: #555;
}

.obol-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.obol-input-group label {
    font-weight: 500;
    color: #555;
}

.obol-input-group input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    width: 100px;
}

.obol-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.distribution-results {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

.distribution-results.show {
    display: block;
}

.distribution-results h4 {
    margin-bottom: 1rem;
    color: #667eea;
}

.distribution-results ul {
    list-style: none;
}

.distribution-results li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

/* Run Page */
.run-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.run-container h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
}

.refresh-info {
    margin-top: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 0 1rem;
    }
    
    .admin-container,
    .run-container {
        padding: 1rem;
    }
    
    .party-table {
        font-size: 0.9rem;
    }
    
    .party-table th,
    .party-table td {
        padding: 0.5rem;
    }
    
    .obol-input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .obol-input-group input {
        width: 100%;
    }
}
