/* ============================================
   TRADE SIMULATION GAME - MAIN STYLESHEET
   ============================================ */

:root {
    --primary: #2980b9;
    --primary-dark: #1a5276;
    --primary-light: #3498db;
    --success: #27ae60;
    --success-light: #2ecc71;
    --danger: #c0392b;
    --danger-light: #e74c3c;
    --warning: #f39c12;
    --warning-light: #f1c40f;
    --dark: #2c3e50;
    --dark-light: #34495e;
    --gray: #7f8c8d;
    --gray-light: #bdc3c7;
    --gray-lighter: #ecf0f1;
    --white: #1f2d3d;
    --button-text: #ffffff;
    --bg: #eef3f8;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: rgba(247, 251, 255, 0.95);
    --text: #223243;
    --text-muted: #637487;
    --border: rgba(216, 226, 236, 0.5);
    --glow-green: #00e676;
    --glow-blue: #448aff;
    --radius: 12px;
    --shadow: 0 10px 28px rgba(26, 50, 67, 0.12);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    background-image: url('bg_gemi.jpg'), url('bg_gemi.jpg');
    background-position: left top, right top;
    background-repeat: no-repeat, no-repeat;
    background-size: auto 100vh, auto 100vh;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Konteynerları tam dikey olarak ortalar */
    padding: 20px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Mobil cihazlarda sadece tek gemi kalsın ve ortalansın */
@media (max-width: 1100px) {
    body {
        background-image: url('bg_gemi.jpg');
        background-position: center top;
        background-repeat: no-repeat;
        background-size: auto 100vh;
    }
}

/* --- Container --- */
.container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 460px;
    text-align: center;
    margin: auto;
    /* hizalamayı flexboxa bıraktık */
}

.game-container {
    max-width: 750px;
}

/* --- Typography --- */
h2 {
    color: var(--white);
    margin-bottom: 30px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h3 {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

p {
    color: var(--text-muted);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

a:hover {
    color: var(--glow-blue);
    text-decoration: underline;
}

/* --- Forms --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--glow-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(68, 138, 255, 0.15);
}

select {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899a6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select:focus {
    border-color: var(--glow-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(68, 138, 255, 0.15);
}

select option {
    background: var(--bg-card);
    color: var(--text);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.4);
}

button:active {
    transform: translateY(0);
}

.message {
    margin-top: 15px;
    font-size: 14px;
    color: var(--danger-light);
    min-height: 20px;
}

.rule-warning {
    text-align: left;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.35);
    color: #9a6500;
}

/* ============================================
   STEP PROGRESS INDICATOR
   ============================================ */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    background: var(--bg);
    border: 2px solid var(--border);
    color: var(--gray);
}

.step-item.completed .step-circle {
    background: var(--glow-green);
    border-color: var(--glow-green);
    color: var(--bg);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4), 0 0 40px rgba(0, 230, 118, 0.15);
}

.step-item.active .step-circle {
    background: var(--bg);
    border: 3px solid var(--glow-green);
    color: var(--glow-green);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3), 0 0 40px rgba(0, 230, 118, 0.1);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 230, 118, 0.3), 0 0 40px rgba(0, 230, 118, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 230, 118, 0.5), 0 0 60px rgba(0, 230, 118, 0.2);
    }
}

.step-label {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.step-item.completed .step-label,
.step-item.active .step-label {
    color: var(--glow-green);
}

.step-connector {
    flex: 1;
    height: 3px;
    background: var(--border);
    margin: 0 -2px;
    position: relative;
    top: -12px;
    z-index: 1;
    min-width: 40px;
    transition: background 0.5s ease;
}

.step-connector.completed {
    background: var(--glow-green);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}

.step-item.completed .step-circle::after {
    content: '\2713';
    font-size: 22px;
    font-weight: 900;
}

.step-item.completed .step-circle span {
    display: none;
}

/* ============================================
   STAT BOXES
   ============================================ */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 140px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--glow-blue);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-value.gold {
    color: var(--warning-light);
}

.stat-value.green {
    color: var(--glow-green);
}

.stat-value.blue {
    color: var(--glow-blue);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(68, 138, 255, 0.3);
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.col {
    flex: 1;
    min-width: 200px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-play {
    background: linear-gradient(135deg, var(--success), #1e8449) !important;
    font-size: 18px !important;
    padding: 16px !important;
    margin-top: 24px !important;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-play:hover {
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.5) !important;
}

.btn-play::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-play:hover::before {
    opacity: 1;
}

.btn-new-game {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    font-size: 16px;
    padding: 14px;
    margin-top: 15px;
    display: inline-block;
    width: 100%;
    text-align: center;
    color: var(--button-text) !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-new-game:hover {
    box-shadow: 0 6px 25px rgba(41, 128, 185, 0.5);
    transform: translateY(-2px);
    text-decoration: none !important;
    color: var(--button-text) !important;
}

.btn-secondary {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 14px;
    padding: 10px;
}

.btn-secondary:hover {
    border-color: var(--gray) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

/* ============================================
   LOG BOX / GAME HISTORY
   ============================================ */
.log-box {
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
}

.log-box::-webkit-scrollbar {
    width: 6px;
}

.log-box::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 3px;
}

.log-box::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.log-box::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

.log-entry {
    border-bottom: 1px solid var(--border);
    padding: 12px 8px;
    transition: background 0.2s;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:hover {
    background: var(--bg-card-hover);
}

.log-entry .log-round {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.log-entry .log-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-good {
    color: var(--glow-green) !important;
    font-weight: 700;
}

.result-bad {
    color: var(--danger-light) !important;
    font-weight: 700;
}

.result-warn {
    color: var(--warning) !important;
    font-weight: 700;
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */
.game-over-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg));
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-over-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--glow-green), var(--glow-blue), var(--warning-light));
}

.game-over-card h1 {
    font-size: 32px;
    color: var(--white);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.game-over-card .final-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.final-stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 30px;
    min-width: 150px;
}

.final-stat .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.final-stat .value {
    font-size: 28px;
    font-weight: 800;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    background: none;
}

.tab:hover {
    color: var(--text);
    background: var(--bg-card-hover);
    text-decoration: none;
}

.tab.active {
    background: var(--primary);
    color: var(--button-text);
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-container {
    max-width: 1100px;
    text-align: left;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h2 {
    margin-bottom: 0;
}

.admin-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-nav a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.search-form button {
    width: auto;
    margin: 0;
    padding: 12px 20px;
    white-space: nowrap;
}

.btn-filter {
    background: linear-gradient(135deg, #636e72, #2d3436) !important;
}

.btn-export {
    background: linear-gradient(135deg, var(--success), #1e8449) !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #922b21) !important;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.admin-stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.admin-stat-card .as-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.admin-stat-card .as-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.admin-table thead {
    background: var(--dark-light);
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.admin-table tbody tr {
    transition: background 0.2s;
}

.admin-table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(0, 230, 118, 0.15);
    color: var(--glow-green);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger-light);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.badge-info {
    background: rgba(68, 138, 255, 0.15);
    color: var(--glow-blue);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.pagination a:hover {
    border-color: var(--glow-blue);
    color: var(--white);
    text-decoration: none;
}

.pagination span.current {
    background: var(--primary);
    color: var(--button-text);
    border: 1px solid var(--primary);
}

/* --- Auth --- */
.auth-container {
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--glow-blue), var(--glow-green));
    border-radius: var(--radius) var(--radius) 0 0;
}

.auth-container h2 {
    margin-top: 10px;
}

.auth-link {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-in-delay {
    animation: fadeInUp 0.4s ease-out 0.15s forwards;
    opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 1.5rem;
    }

    .stats-row,
    .row {
        flex-direction: column;
    }

    .step-connector {
        min-width: 20px;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}