/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

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

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #ffd700;
}

.login-card input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-card input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.error-message {
    color: #ff4757;
    margin-top: 15px;
    font-weight: bold;
}

/* Admin Panel */
.admin-panel {
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 2px solid #ffd700;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo h1 {
    font-size: 1.8rem;
    color: #ffd700;
}

.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

/* Admin Main */
.admin-main {
    padding: 40px 0;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    font-size: 2.5rem;
    color: #ffd700;
}

.stat-info h3 {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 5px;
}

.stat-info p {
    color: rgba(255, 255, 255, 0.8);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.tab-btn.active {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border-color: #ffd700;
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Wheel Control Panel */
.wheel-control-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.wheel-control-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #ffd700;
}

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

.setting-group {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-group label {
    font-weight: bold;
    color: #ffd700;
    min-width: 150px;
}

.setting-group select {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.set-prize-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #2ed573, #1e8449);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.set-prize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.4);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ffd700;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Wheel Preview */
.wheel-preview {
    text-align: center;
    margin-top: 30px;
}

.wheel-preview h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #ffd700;
}

#adminWheelCanvas {
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 2px solid #ffd700;
}

/* Tables */
.users-table-container,
.ip-table-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.users-table,
.ip-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td,
.ip-table th,
.ip-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.users-table th,
.ip-table th {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    font-weight: bold;
}

.users-table tr:hover,
.ip-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Action Buttons */
.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.ban-btn {
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
}

.unban-btn {
    background: linear-gradient(45deg, #2ed573, #1e8449);
    color: white;
}

.view-btn {
    background: linear-gradient(45deg, #3742fa, #2f3542);
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* IP Stats */
.ip-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ip-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ip-stat-card i {
    font-size: 2.5rem;
    color: #ffd700;
}

.ip-stat-info h3 {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 5px;
}

/* Logs */
.logs-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logs-controls {
    margin-bottom: 20px;
    text-align: right;
}

.clear-logs-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-logs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.logs-container {
    max-height: 500px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border-left: 4px solid #ffd700;
}

.log-entry.error {
    border-left-color: #ff4757;
}

.log-entry.success {
    border-left-color: #2ed573;
}

.log-time {
    color: #ffd700;
    font-weight: bold;
    margin-right: 10px;
}

/* Chat Admin Panel */
.chat-admin-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.chat-admin-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #ffd700;
}

.chat-sections {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
}

.chat-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.active-users-list {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-weight: bold;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: bold;
    color: #fff;
}

.user-ip {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.user-status {
    font-size: 0.8rem;
}

.user-status.online {
    color: #2ed573;
}

.user-status.away {
    color: #ffa502;
}

.join-chat-btn {
    background: linear-gradient(45deg, #3742fa, #2f3542);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.join-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(55, 66, 250, 0.3);
}

.chat-window {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
}

.message.admin {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
    align-self: flex-end;
}

.message.user {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: flex-start;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.message-sender {
    font-weight: bold;
    color: #ffd700;
}

.message-time {
    color: rgba(255, 255, 255, 0.5);
}

.message-text {
    color: #fff;
    line-height: 1.4;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#adminMessageInput {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px;
    color: white;
    resize: none;
    height: 60px;
    outline: none;
}

#adminMessageInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.attach-btn, .voice-btn, .send-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.attach-btn:hover, .voice-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.send-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.chat-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Media Panel */
.media-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.media-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #ffd700;
}

.media-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.media-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.media-section .setting-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.media-section input,
.media-section textarea,
.media-section select {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.media-section input::placeholder,
.media-section textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.media-section input[type="file"] {
    padding: 8px;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.media-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.media-info strong {
    color: #ffd700;
}

.media-type {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 215, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.media-delete {
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: left;
    }
    
    .wheel-settings {
        grid-template-columns: 1fr;
    }
    
    .setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-group label {
        min-width: auto;
    }
    
    .users-table,
    .ip-table {
        font-size: 0.9rem;
    }
    
    .users-table th,
    .users-table td,
    .ip-table th,
    .ip-table td {
        padding: 10px 5px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .media-section .setting-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    #adminWheelCanvas {
        width: 250px;
        height: 250px;
    }
}