/* =========================================
   GENERIC MODAL STRUCTURE
   ========================================= */

/* Modal Overlay */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.custom-modal {
    background: var(--card-bg, var(--surface-800, #0d0d0d));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    padding: 14px;
    box-shadow: 0 10px 40px color-mix(in srgb, var(--surface-900, #050505) 80%, transparent);
    font-family: var(--font-main, 'Inter', sans-serif);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cm-sponsor-logo {
    height: 24px;
    object-fit: contain;
}

.cm-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-light);
}

.cm-close {
    background: var(--border-subtle, rgba(255, 255, 255, 0.05));
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.cm-close:hover {
    background: var(--border-soft, rgba(255, 255, 255, 0.1));
    color: var(--text-light);
}

.cm-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.cm-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #cbd5e1);
    margin-bottom: 8px;
}

.cm-form-group input,
.cm-form-group select,
.cm-form-group textarea {
    background: var(--surface-900, #050505);
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.cm-form-group input:focus,
.cm-form-group select:focus,
.cm-form-group textarea:focus {
    border-color: var(--brand-red, #f59e0b);
    background: var(--surface-800, #111111);
}

.cm-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.cm-input-with-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 18px;
}

.cm-input-with-icon input {
    width: 100%;
    padding-left: 40px;
}

.cm-input-with-icon input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.cm-input-with-icon input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
    cursor: pointer;
}

.cm-helper {
    font-size: 10px;
    color: var(--text-gray);
    margin-top: 6px;
    font-weight: 500;
}

.btn-talep-submit,
.cm-submit-btn {
    width: 100%;
    background: var(--brand-red, #f59e0b);
    color: var(--text-on-accent, #000);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-talep-submit:hover,
.cm-submit-btn:hover {
    background: var(--brand-red-hover);
    box-shadow: 0 4px 15px rgba(var(--primary), 0.4);
}

/* =========================================
   AVATAR MODAL (footer.php'den taşındı)
   ========================================= */

.g-avatar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    backdrop-filter: blur(6px);
}

.g-avatar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.g-avatar-box {
    background: var(--card-bg, var(--surface-800, #141414));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    padding: 28px 24px;
    width: min(90vw, 400px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(.97);
    transition: transform .3s ease;
}

.g-avatar-overlay.active .g-avatar-box {
    transform: translateY(0) scale(1);
}

.g-avatar-head {
    text-align: center;
    margin-bottom: 20px;
}

.g-avatar-icon {
    font-size: 36px;
    color: var(--brand-red, #f59e0b);
    margin-bottom: 8px;
}

.g-avatar-head h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-on-dark, #f1f5f9);
    margin-bottom: 5px;
}

.g-avatar-head p {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
}

.g-avatar-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.g-avatar-opt {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    cursor: pointer;
    overflow: hidden;
    transition: all .2s;
}

.g-avatar-opt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.g-avatar-opt:hover {
    transform: scale(1.05);
    border-color: var(--border-soft, rgba(255, 255, 255, 0.1));
}

.g-avatar-opt.selected {
    border-color: var(--brand-red, #f59e0b);
    box-shadow: 0 0 0 3px rgba(var(--primary), .25);
    transform: scale(1.08);
}

.g-avatar-actions {
    display: flex;
    gap: 10px;
}

.g-avatar-skip,
.g-avatar-save {
    flex: 1;
    padding: 10px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}

.g-avatar-skip {
    background: transparent;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
    color: var(--text-gray);
}

.g-avatar-skip:hover {
    background: var(--border-subtle, rgba(255, 255, 255, 0.05));
    color: var(--text-secondary);
}

.g-avatar-save {
    background: var(--brand-red, #f59e0b);
    border: 1px solid var(--brand-red, #f59e0b);
    color: var(--text-on-accent, #000);
    font-weight: 800;
}

.g-avatar-save:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.g-avatar-save:not(:disabled):hover {
    background: var(--brand-red-hover, #fbbf24);
}

/* =========================================
   404 HATA SAYFASI (404.php'den taşındı)
   ========================================= */

.error-page-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-main, 'Chakra Petch', sans-serif);
    overflow: hidden;
    padding: 40px 20px;
}

.error-page-bg-grid {
    position: absolute;
    inset: 0;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    z-index: 0;
    mask-image: radial-gradient(circle at center, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
}

.error-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: globalPageFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.error-code-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.error-num {
    font-size: 140px;
    font-weight: 900;
    line-height: 1;
    color: color-mix(in srgb, var(--surface-700) 80%, var(--surface-800));
}

.error-target-zero {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-dashed {
    position: absolute;
    inset: 0;
    border: 4px dashed color-mix(in srgb, var(--brand-red, #f59e0b) 40%, transparent);
    border-radius: 50%;
    animation: spinSlow 10s linear infinite;
}

.target-dot {
    width: 24px;
    height: 24px;
    background: var(--brand-red, #f59e0b);
    border-radius: 50%;
    box-shadow: 0 0 20px color-mix(in srgb, var(--brand-red, #f59e0b) 60%, transparent);
    animation: pulseDot 2s ease-in-out infinite;
}

.error-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-on-dark);
    margin: 0 0 12px 0;
}

.error-sub {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 0 32px 0;
    max-width: 400px;
}

.error-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.btn-error-home {
    background: var(--brand-red, #f59e0b);
    color: var(--text-on-accent, #000);
    padding: 0 24px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-error-home:hover {
    background: var(--brand-red-hover, #fbbf24);
}

.btn-error-back {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--surface-700);
    padding: 0 24px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-error-back:hover {
    background: var(--surface-800);
    color: var(--text-on-dark);
}

.error-countdown-wrap {
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-bar {
    width: 100%;
    height: 3px;
    background: var(--surface-700);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.countdown-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-red, #f59e0b);
    transition: width 1s linear;
}

.countdown-text {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

@keyframes spinSlow {
    100% { transform: rotate(360deg); }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

@media (max-width: 600px) {
    .error-num { font-size: 100px; }
    .error-target-zero { width: 80px; height: 80px; }
    .target-dashed { border-width: 3px; }
    .target-dot { width: 18px; height: 18px; }
    .error-title { font-size: 20px; }
    .error-sub { font-size: 13px; padding: 0 16px; }
}

/* =========================================
   INFO TOOLTIP (info.php'den taşındı)
   ========================================= */

.ticket-more-container {
    position: relative;
    display: inline-block;
}

.ticket-more-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: var(--surface-700);
    border: 1px solid var(--surface-600);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    z-index: 50;
    width: max-content;
    max-width: 280px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.ticket-more-container:hover .ticket-more-tooltip {
    opacity: 1;
    visibility: visible;
}

.ticket-more-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--surface-600) transparent transparent transparent;
}

/* =========================================
   ETKİNLİKLER / BİLETLER SATIR INLINE (taşındı)
   ========================================= */

.overlay-finished {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.7);
    z-index: 10;
    pointer-events: none;
    border-radius: 8px;
}

.badge-label-dark {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.82);
    color: var(--text-secondary, #cbd5e1);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.btn-disabled-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn-outlined-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #cbd5e1);
    border-color: rgba(255, 255, 255, 0.1);
}

.text-muted-small {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

/* =========================================
   MARKET DISABLED STATE (market.php'den taşındı)
   ========================================= */

.btn-market-disabled {
    background: var(--surface-600);
    color: var(--text-gray);
    cursor: not-allowed;
}

.text-expired {
    color: var(--brand-red-soft, #fcd34d);
}

/* =========================================
   GOREVLER BOŞ DURUM (gorevler.php'den taşındı)
   ========================================= */

.gorev-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* =========================================
   BİLET DETAY INLINE (bilet-detay.php'den taşındı)
   ========================================= */

.bildet-success-box {
    background: color-mix(in srgb, var(--success-color, #10b981) 12%, transparent);
    border: 1px solid var(--success-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--success-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}


.cm-video-modal {
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cm-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.cm-video-content {
    z-index: 10;
    position: relative;
}