/**
 * Modern CSS styles for Klick-Game
 * Replaces old inline styles with modern CSS
 */

/* General styles */
body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #fff;
    background-color: #2a2a2a;
    background-image: url('/images/body-bg.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0;
    padding: 0;
}

.kg-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Tables */
.table-modern {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table-modern th,
.table-modern td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table-modern thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #343a40;
    color: white;
}

.table-modern tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Market specific styles */
.market-container {
    background-color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1rem;
    margin-bottom: 1rem;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.market-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.market-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.market-tab:hover {
    background-color: #f8f9fa;
}

.market-tab.active {
    background-color: #007bff;
    color: white;
}

.item-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.item-name {
    flex: 2;
    font-weight: 500;
}

.item-stock {
    flex: 1;
    text-align: center;
}

.item-rate {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-price {
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.item-action {
    flex: 1;
    text-align: right;
}

/* Market table styles */
.market-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.market-table th {
    background-color: #BAB3B4;
    color: #000;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #444646;
}

.market-table td {
    background-color: #726B6C;
    color: #fff;
    padding: 0.5rem;
    border: 1px solid #726B6C;
    text-align: center;
}

.market-table tr:hover td {
    background-color: #635E5E;
}

.market-table input[type="text"] {
    width: 50px;
    text-align: center;
    padding: 0.25rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.market-table input[type="submit"] {
    padding: 0.25rem 0.5rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.market-table input[type="submit"]:hover {
    background-color: #0069d9;
}

/* Market error and success messages */
.market-success {
    background-color: #132d3d;
    border: 1px solid #328727;
    padding: 0.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.market-error {
    background-color: #2a2636;
    border: 1px solid #cc520d;
    padding: 0.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

/* Tooltips */
.tooltip, .tooltip2, .tooltip3, .tooltip4, .tooltip5, .tooltip-fixed {
    position: absolute;
    z-index: 1070;
    display: none;
    margin: 0;
    font-family: inherit;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: 0.875rem;
    word-wrap: break-word;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.tooltip {
    background-color: #e4e4e4;
    color: #000;
    padding: 0.25rem 0.5rem;
}

.tooltip2 {
    background-color: #716b6b;
    border: 1px solid #000000;
    padding: 2px;
    color: #fff;
}

.tooltip3 {
    background-color: #fff;
    border: 1px solid #000000;
    color: #000;
}

.tooltip3 .head {
    background-image: url(//cdn.klick-game.de/images/bg1.gif);
    text-align: center;
    color: #000000;
    font-weight: bold;
    padding: 2px;
}

.tooltip4 {
    background-color: #fff;
    border: 1px solid #000000;
    color: #000;
}

.tooltip5 {
    background-color: #fff;
    border: 1px solid #000000;
    color: #000;
}

.tooltip.show, .tooltip2.show, .tooltip3.show, .tooltip4.show, .tooltip5.show, .tooltip-fixed.show {
    display: block;
}

.tooltip-inner {
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    text-align: center;
    background-color: #000;
    border-radius: 0.25rem;
}

/* Cursor styles */
.cursor-pointer {
    cursor: pointer;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

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

.p-2 {
    padding: 0.5rem;
}

.m-2 {
    margin: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.bg-dark {
    background-color: #343a40;
    color: white;
}

.bg-light {
    background-color: #f8f9fa;
}

.bg-success {
    background-color: #28a745;
    color: white;
}

.bg-danger {
    background-color: #dc3545;
    color: white;
}

.bg-warning {
    background-color: #ffc107;
}

.bg-info {
    background-color: #17a2b8;
    color: white;
}

/* Form controls */
.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0 0.25rem 0.25rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #fff;
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

/* Alerts */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Alert container for JavaScript alerts */
.alert-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    max-width: 300px;
}

.alert-container .alert {
    margin-bottom: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Responsive utilities */
@media (max-width: 576px) {
    .d-sm-none {
        display: none !important;
    }

    .d-sm-block {
        display: block !important;
    }

    .d-sm-flex {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }

    .d-md-flex {
        display: flex !important;
    }
}

@media (max-width: 992px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }

    .d-lg-flex {
        display: flex !important;
    }
}

/* ============================================
   Responsive Enhancements for Modern Style
   ============================================ */

/* Mobile-First Responsive Tables */
@media (max-width: 767px) {
    .table-modern {
        font-size: 0.875rem;
    }

    .table-modern thead {
        display: none;
    }

    .table-modern,
    .table-modern tbody,
    .table-modern tr,
    .table-modern td {
        display: block;
        width: 100%;
    }

    .table-modern tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
        overflow: hidden;
    }

    .table-modern td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #dee2e6;
    }

    .table-modern td:last-child {
        border-bottom: none;
    }

    .table-modern td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 0.75rem;
        font-weight: bold;
        text-align: left;
    }
}

/* Responsive Market Container */
@media (max-width: 767px) {
    .market-container {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .market-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .market-tabs {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .market-tab {
        width: 100%;
        text-align: center;
    }

    .item-row {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0.5rem;
    }

    .item-name,
    .item-stock,
    .item-rate,
    .item-price,
    .item-action {
        text-align: left !important;
        width: 100%;
    }

    .item-name {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .item-rate {
        justify-content: flex-start;
    }
}

/* Responsive Market Table */
@media (max-width: 767px) {
    .market-table {
        display: block;
        overflow-x: auto;
    }

    .market-table thead {
        display: none;
    }

    .market-table tbody,
    .market-table tr,
    .market-table td {
        display: block;
        width: 100%;
    }

    .market-table tr {
        margin-bottom: 1rem;
        padding: 0.5rem;
        border: 2px solid #444646;
        border-radius: 0.25rem;
    }

    .market-table td {
        text-align: left !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .market-table td:before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }

    .market-table input[type="text"] {
        width: 100px;
        flex-shrink: 0;
    }

    .market-table input[type="submit"] {
        width: auto;
        padding: 0.5rem 1rem;
    }
}

/* Responsive Tooltips */
@media (max-width: 767px) {
    .tooltip,
    .tooltip2,
    .tooltip3,
    .tooltip4,
    .tooltip5 {
        max-width: 90vw !important;
        font-size: 0.8rem;
    }

    .tooltip3 .head {
        font-size: 0.9rem;
    }
}

/* Responsive Form Controls */
@media (max-width: 767px) {
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.5rem;
    }

    .form-control-sm {
        font-size: 14px;
    }
}

/* Responsive Buttons */
@media (max-width: 767px) {
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Inline buttons on mobile */
    .btn-inline-mobile {
        display: inline-block;
        width: auto;
        margin-right: 0.5rem;
    }
}

/* Responsive Utility Classes - Mobile */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }

    .text-left-mobile {
        text-align: left !important;
    }

    .flex-column-mobile {
        flex-direction: column !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }

    .p-1-mobile {
        padding: 0.25rem !important;
    }

    .p-2-mobile {
        padding: 0.5rem !important;
    }

    .m-0-mobile {
        margin: 0 !important;
    }

    .mb-2-mobile {
        margin-bottom: 0.5rem !important;
    }

    .d-none-mobile {
        display: none !important;
    }

    .d-block-mobile {
        display: block !important;
    }
}

/* Tablet Responsive Adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .market-container {
        padding: 0.75rem;
    }

    .table-modern {
        font-size: 0.9rem;
    }

    .item-row {
        font-size: 0.9rem;
    }
}

/* Desktop Optimizations */
@media (min-width: 992px) {
    /* Hover effects for desktop only */
    .market-tab:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
    }

    .table-modern tbody tr:hover {
        transform: scale(1.01);
        transition: transform 0.2s;
    }

    .btn:hover,
    button:hover {
        transform: translateY(-1px);
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
        transition: all 0.2s;
    }
}

/* Large Desktop Enhancements */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .market-container {
        padding: 1.5rem;
    }

    .table-modern {
        font-size: 1rem;
    }
}

/* Extra Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 767px) and (orientation: landscape) {
    body {
        font-size: 13px;
    }

    .market-container {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .table-modern td,
    .table-modern th {
        border-width: 0.5px;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Placeholder for dark mode styles */
    /* Can be implemented later if needed */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Optimizations */
@media print {
    .market-container,
    .table-modern {
        page-break-inside: avoid;
    }

    .no-print,
    button,
    .btn,
    input[type="submit"],
    input[type="button"] {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ===================================
   EVENT SYSTEM STYLES
   =================================== */

.event-indicator {
    position: relative;
}

.event-badge {
    background: linear-gradient(135deg, #ff6b00 0%, #ffa500 100%);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse-event 2s infinite;
}

@keyframes pulse-event {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 107, 0, 1);
    }
}

/* Event Center specific styles are inline in event-center.php */

/* Event notification in sidebar */
.sidebar .event-indicator {
    background: rgba(255, 107, 0, 0.1);
    border-left: 3px solid #ff6b00;
}

.sidebar .event-indicator:hover {
    background: rgba(255, 107, 0, 0.2);
}
