* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #1b5fc1;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1b5fc1;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    color: #2d3748;
    text-align: center;
    font-size: 28px;
}

/* Admin Header */
.admin-header {
    background: #2d3748;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    display: inline-block;
    margin-right: 20px;
    font-size: 24px;
}

.admin-nav {
    float: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-nav span {
    color: #e2e8f0;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #2d3748;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.empty-state p {
    color: #718096;
    margin-bottom: 20px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.event-thumb {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.event-info {
    padding: 20px;
}

.event-info h3 {
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 18px;
}

.event-description {
    color: #718096;
    font-size: 14px;
    margin-bottom: 10px;
}

.event-code {
    background: #edf2f7;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
    color: #3182ce;
    margin-bottom: 10px;
    font-size: 14px;
}

.event-stats {
    color: #718096;
    margin-bottom: 15px;
    font-size: 14px;
}

.event-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1b5fc1;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* Event Management */
.event-details {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.event-access {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.event-access h3 {
    margin-bottom: 20px;
    color: #2d3748;
}

.access-info {
    display: grid;
    gap: 20px;
}

.access-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
}

.code-display {
    background: #1b5fc1;
    color: white;
    padding: 20px;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 4px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.access-item input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Questions Panel */
.questions-panel {
    margin-top: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    color: #2d3748;
}

.question-item {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.question-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.question-item.starred {
    background: #fffbeb;
    border-color: #fbbf24;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.author {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.upvotes {
    background: #edf2f7;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.question-text {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #2d3748;
    word-wrap: break-word;
}

.question-meta {
    margin-bottom: 12px;
}

.question-meta small {
    color: #a0aec0;
    font-size: 12px;
}

.question-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.no-data {
    text-align: center;
    color: #a0aec0;
    padding: 60px 20px;
    font-size: 16px;
}

/* Participant Page */
.participant-page {
    background: #f5f7fa;
}

.event-header {
    background: #1b5fc1;
    background-size: cover;
    background-position: center;
    color: white;
    padding: 20px 20px;
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

.event-header .container {
    position: relative;
    z-index: 1;
}

.participant-content {
    padding: 0 0 40px 0;
}

.question-form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.question-form-container h2 {
    margin-bottom: 25px;
    color: #2d3748;
}

.questions-list-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.questions-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.questions-list-container h2 {
    color: #2d3748;
}

.question-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.question-card:hover {
    border-color: #cbd5e0;
    transform: translateX(5px);
}

.question-content {
    margin-bottom: 12px;
}

.question-edit-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #3182ce;
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 14px;
}

.upvote-btn {
    background: #edf2f7;
    border: 2px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #4a5568;
    position: relative;
    min-width: 70px;
}

.upvote-btn:hover:not(:disabled) {
    background: #3182ce;
    color: white;
    border-color: #1b5fc1;
    transform: scale(1.05);
}

.upvote-btn.voted {
    background: #3182ce;
    color: white;
    border-color: #1b5fc1;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.upvote-btn.voted:hover:not(:disabled) {
    background: #3182ce;
    border-color: #1b5fc1;
}

.upvote-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.upvote-btn .btn-loader {
    display: inline-block;
    margin-left: 5px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip untuk button state */
.upvote-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.upvote-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Visual feedback saat toggle */
.upvote-btn:active {
    transform: scale(0.95);
}

.upvote-btn.voted:active {
    transform: scale(0.95);
}

/* Badge untuk menunjukkan status voted */
.question-card[data-voted="true"] {
    border-left: 3px solid #1b5fc1;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.question-time {
    font-size: 12px;
    color: #a0aec0;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .event-header h1 {
        font-size: 1.8em;
    }
    
    .event-header p {
        font-size: 1em;
    }
    
    .admin-header h1 {
        display: block;
        margin-bottom: 10px;
        font-size: 20px;
    }
    
    .admin-nav {
        float: none;
        justify-content: flex-start;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .event-card {
        margin-bottom: 15px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .event-details {
        padding: 20px;
    }
    
    .question-form-container,
    .questions-list-container {
        padding: 20px;
    }
    
    .code-display {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .question-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .login-box {
        padding: 25px;
    }
    
    .event-actions {
        flex-direction: column;
    }
    
    .event-actions .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}