/* VoteOnIt Admin Styles */

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

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

/* Navbar */
.navbar {
    background: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
    background: #ecf0f1;
    color: #333;
}

.btn:hover {
    background: #bdc3c7;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

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

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.875rem;
}

/* Data Table */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: #95a5a6;
    color: #fff;
}

.status-active {
    background: #27ae60;
    color: #fff;
}

.status-closed {
    background: #e74c3c;
    color: #fff;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-btn:hover {
    color: #333;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
}

.login-box {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

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

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Quick Actions */
.quick-actions {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Results */
.rating-cell {
    min-width: 200px;
}

.rating-bar-container {
    position: relative;
    height: 20px;
    background: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.rating-bar {
    position: absolute;
    height: 100%;
    background: #3498db;
    opacity: 0.5;
    border-radius: 4px;
}

.rating-mu {
    position: absolute;
    width: 4px;
    height: 100%;
    background: #2c3e50;
    border-radius: 2px;
}

.rating-value {
    font-weight: 600;
    color: #2c3e50;
}

.rank-cell {
    font-size: 1.25rem;
    font-weight: bold;
    color: #3498db;
    text-align: center;
}

.help-text {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Chart */
.chart-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bar-chart {
    margin-top: 1rem;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.bar-label {
    width: 150px;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.3s;
}

.bar-value {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* Voting Links */
.voting-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.voting-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.voting-links li:last-child {
    border-bottom: none;
}

.voting-url {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.url-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    background: #f8f9fa;
    color: #666;
}

.invite-success {
    background: #d4edda;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.invite-success h5 {
    margin: 0 0 0.75rem 0;
    color: #155724;
}

.invite-failed {
    background: #f8d7da;
    border-radius: 4px;
    padding: 1rem;
}

.invite-failed h5 {
    margin: 0 0 0.5rem 0;
    color: #721c24;
}

.invite-failed ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }
}
