* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #030102;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

.hero-header {
    position: relative;
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    height: 300px;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-header {
        height: 560px;
    }
    .main-content {
        padding: 10px 20px;
    }
}

@media (min-width: 1024px) {
    .hero-header {
        height: 460px;
    }
}

@media (min-width: 1280px) {
    .hero-header {
        height: 700px;
    }
}

@media (min-width: 1536px) {
    .hero-header {
        height: 780px;
    }
}

/* Main Content */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

/* Form Container */
.form-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 35px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

/* Form */
.tournament-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    letter-spacing: 0.3px;
}

.form-input,
.form-select {
    background-color: #0f0f0f;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: #555;
}

.form-input:focus,
.form-select:focus {
    border-color: #ffd700;
    background-color: #141414;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.form-input:hover,
.form-select:hover {
    border-color: #3a3a3a;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-select option {
    background-color: #0f0f0f;
    color: #ffffff;
    padding: 10px;
}

/* Submit Button */
.submit-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000000;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.submit-button:active {
    transform: translateY(0);
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-icon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.submit-button:hover .button-icon {
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 30px 25px;
    }

    .form-title {
        font-size: 24px;
    }

    .main-content {
        padding: 30px 15px;
    }
}

/* ============================================
   PANEL PAGE STYLES
   ============================================ */

.panel-body {
    position: relative;
    height: 100vh;
    overflow-x: hidden;
}

.panel-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    opacity: 0.15;
    z-index: -1;
}

.panel-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.panel-container-wide {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    max-width: 2800px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
}

.panel-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.panel-title {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.panel-subtitle {
    color: #999;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 15px;
}

.total-count {
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 170, 0, 0.2) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #ffd700;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.logout-button:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: rgba(255, 68, 68, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

@media (max-width: 1400px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

/* Table Card */
.table-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.table-card-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.table-card-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.table-count {
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 170, 0, 0.15) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.game-status {
    margin-top: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.game-status.status-waiting {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.15) 0%, rgba(220, 80, 80, 0.15) 100%);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff9999;
}

.game-status.status-ready {
    background: linear-gradient(135deg, rgba(0, 255, 100, 0.15) 0%, rgba(0, 200, 80, 0.15) 100%);
    border: 1px solid rgba(0, 255, 100, 0.3);
    color: #66ff99;
    animation: pulse-ready 2s ease-in-out infinite;
}

@keyframes pulse-ready {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 100, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 255, 100, 0);
    }
}

.table-container-inner {
    overflow-x: auto;
}

/* Search box in table cards */
.table-card .dataTables_filter {
    margin-bottom: 15px;
    text-align: center;
}

.table-card .dataTables_filter label {
    justify-content: center;
    font-size: 13px;
}

.table-card .dataTables_filter input {
    margin-left: 8px;
    width: 200px;
}

/* Table Container */
.table-container {
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    overflow-x: auto;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
}

.data-table thead {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

.data-table thead tr th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.data-table thead tr th:first-child {
    border-radius: 12px 0 0 0;
}

.data-table thead tr th:last-child {
    border-radius: 0 12px 0 0;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 215, 0, 0.05);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr td {
    padding: 18px 20px;
    font-size: 15px;
    color: #e0e0e0;
}

.text-center {
    text-align: center;
}

/* Badges */
.badge-nick {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #a8b8ff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

/* Empty Slot Styles */
.empty-slot {
    color: #444;
    font-style: italic;
    font-size: 13px;
}

.empty-slot-badge {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.15) 0%, rgba(80, 80, 80, 0.15) 100%);
    border: 1px dashed rgba(150, 150, 150, 0.3);
    color: #666;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    font-style: italic;
}

/* Empty row styling */
.data-table tbody tr:has(.empty-slot) {
    opacity: 0.5;
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:has(.empty-slot):hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.badge-game {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 170, 0, 0.2) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

/* Delete Button */
.btn-delete {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.btn-delete:active {
    transform: translateY(0);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-row p,
.empty-row p,
.error-row p {
    color: #999;
    font-size: 15px;
    padding: 20px;
}

.empty-message {
    color: #666;
}

.error-message {
    color: #ff4444;
}

/* Responsive Table */
@media (max-width: 768px) {
    .panel-container {
        padding: 30px 15px;
    }

    .panel-title {
        font-size: 28px;
    }

    .table-container {
        padding: 20px;
        border-radius: 15px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table thead tr th,
    .data-table tbody tr td {
        padding: 12px 10px;
        font-size: 12px;
    }

    .badge-nick,
    .badge-game {
        font-size: 11px;
        padding: 4px 8px;
    }

    .btn-delete {
        padding: 6px 10px;
    }
}

/* ============================================
   DATATABLES CUSTOM STYLES
   ============================================ */

/* DataTables wrapper */
.dataTables_wrapper {
    color: #ffffff;
}

/* Search input */
.dataTables_filter {
    margin-bottom: 20px;
}

.dataTables_filter label {
    color: #e0e0e0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dataTables_filter input {
    background-color: #0f0f0f;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 16px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.dataTables_filter input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

/* Length menu */
.dataTables_length {
    margin-bottom: 20px;
}

.dataTables_length label {
    color: #e0e0e0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dataTables_length select {
    background-color: #0f0f0f;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    padding: 8px 12px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    margin: 0 10px;
    cursor: pointer;
}

.dataTables_length select:focus {
    border-color: #ffd700;
}

/* Info text */
.dataTables_info {
    color: #999;
    font-size: 14px;
    padding-top: 20px;
}

/* Pagination */
.dataTables_paginate {
    padding-top: 20px;
}

.dataTables_paginate .paginate_button {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700 !important;
    padding: 8px 14px;
    border-radius: 8px;
    margin: 0 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.dataTables_paginate .paginate_button:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700 !important;
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border-color: #ffd700;
    color: #000000 !important;
}

.dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000000 !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Processing indicator */
.dataTables_processing {
    background: rgba(10, 10, 10, 0.95);
    color: #ffd700;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    font-weight: 600;
}

/* Sorting icons */
.data-table thead th {
    cursor: pointer;
    position: relative;
}

.data-table thead .sorting:after,
.data-table thead .sorting_asc:after,
.data-table thead .sorting_desc:after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 12px;
}

.data-table thead .sorting:after {
    content: '⇅';
}

.data-table thead .sorting_asc:after {
    content: '↑';
    opacity: 1;
}

.data-table thead .sorting_desc:after {
    content: '↓';
    opacity: 1;
}

/* Empty table message */
.dataTables_empty {
    color: #666;
    padding: 40px !important;
    text-align: center;
    font-size: 16px;
}

/* Responsive DataTables */
@media (max-width: 768px) {
    .dataTables_filter label,
    .dataTables_length label {
        flex-direction: column;
        align-items: flex-start;
    }

    .dataTables_filter input,
    .dataTables_length select {
        margin: 10px 0 0 0;
        width: 100%;
    }

    .dataTables_paginate .paginate_button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================
   PANEL LOGIN PAGE STYLES
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.lock-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: #ffd700;
    stroke-width: 1.5;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000000;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.login-button:active {
    transform: translateY(0);
}

.error-message-box {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.2) 0%, rgba(204, 0, 0, 0.2) 100%);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* Responsive Login */
@media (max-width: 768px) {
    .login-box {
        padding: 40px 30px;
    }

    .login-title {
        font-size: 28px;
    }

    .lock-icon {
        width: 50px;
        height: 50px;
    }
}
