@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

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

body {
    font-family: 'Crimson Text', serif;
    background: #0a0a0a;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(20, 20, 20, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(10, 10, 10, 0.8) 0%, transparent 50%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    color: #d4d4d4;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
    border-bottom: 2px solid #3a3a3a;
    color: #d4d4d4;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4a4a4a, transparent);
}

header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e8e8e8;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.user-info {
    font-size: 1em;
    color: #999;
    font-style: italic;
}

.room-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #3a3a3a;
    padding: 10px 15px;
    border-radius: 0;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

main {
    padding: 30px;
    background: #151515;
}

.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 1px solid #3a3a3a;
    border-radius: 0;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: #1a1a1a;
    color: #d4d4d4;
    text-transform: uppercase;
}

.btn:hover {
    background: #2a2a2a;
    border-color: #4a4a4a;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: #0f0f0f;
    border-color: #4a4a4a;
    color: #d4d4d4;
}

.btn-primary:hover {
    background: #1a1a1a;
    border-color: #5a5a5a;
}

.btn-secondary {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #999;
}

.btn-secondary:hover {
    background: #2a2a2a;
    border-color: #4a4a4a;
    color: #d4d4d4;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
}

.btn-payment {
    background: #0f0f0f;
    border-color: #4a4a4a;
    color: #d4d4d4;
}

.btn-payment:hover {
    background: #1a1a1a;
    border-color: #5a5a5a;
}

.rooms-section h2 {
    margin-bottom: 20px;
    color: #e8e8e8;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.8em;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 10px;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.room-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #3a3a3a;
}

.room-card:hover {
    background: #1f1f1f;
    border-color: #3a3a3a;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.room-header h3 {
    color: #d4d4d4;
    font-size: 1.3em;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.room-code {
    background: #0f0f0f;
    color: #d4d4d4;
    border: 1px solid #3a3a3a;
    padding: 5px 10px;
    border-radius: 0;
    font-weight: bold;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.room-description {
    color: #999;
    margin-bottom: 15px;
    line-height: 1.6;
    font-style: italic;
}

.room-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    border-top: 1px solid #2a2a2a;
    padding-top: 10px;
}

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

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.section {
    margin-bottom: 40px;
    padding: 25px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3a3a3a, transparent);
}

.section h2 {
    margin-bottom: 20px;
    color: #e8e8e8;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.6em;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 10px;
}

.section-note {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
    font-style: italic;
}

/* Timer section */
.timer-section {
    text-align: center;
    padding: 35px 25px;
}

.big-timer {
    margin-bottom: 15px;
}

.timer-digits {
    font-family: 'Courier New', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    color: #e8e8e8;
    letter-spacing: 0.05em;
}

.timer-sep {
    margin: 0 4px;
    color: #4a4a4a;
}

.timer-labels {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 30px);
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
}

.timer-labels span { min-width: 3ch; }

.timer-target {
    color: #999;
    font-size: 1em;
    margin-bottom: 20px;
}

.will-it-happen {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    color: #d4d4d4;
    margin: 20px 0 10px;
    border: none;
    padding: 0;
}

.condition-desc-main {
    color: #999;
    margin-bottom: 15px;
}

.winner-announce {
    margin-top: 20px;
    padding: 15px;
    background: #0f0f0f;
    border: 1px solid #3a3a3a;
    color: #d4d4d4;
}

.winner-announce small { color: #999; }

/* Guesses list */
.guesses-list {
    margin-top: 15px;
}

.guess-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.95em;
}

.guess-row:last-child { border-bottom: none; }

.guess-name {
    font-weight: bold;
    color: #d4d4d4;
}

.guess-datetime {
    font-family: 'Courier New', monospace;
    color: #999;
}

.guess-prediction {
    color: #999;
}

.empty-guesses {
    color: #666;
    font-style: italic;
    padding: 20px 0;
}

/* Prize section */
.prize-section {
    border-top: 2px solid #3a3a3a;
}

.prize-condition-note {
    color: #999;
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.6;
}

.prize-content {
    color: #d4d4d4;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #2a2a2a;
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.participant-item {
    background: #0f0f0f;
    padding: 15px;
    border-radius: 0;
    border: 1px solid #2a2a2a;
    min-width: 200px;
}

.participant-item span {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #d4d4d4;
}

.participant-item small {
    color: #666;
    font-size: 0.9em;
}

.conditions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.condition-card {
    background: #0f0f0f;
    padding: 15px;
    border-radius: 0;
    border: 1px solid #2a2a2a;
}

.condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.condition-type {
    background: #1a1a1a;
    color: #d4d4d4;
    border: 1px solid #3a3a3a;
    padding: 5px 10px;
    border-radius: 0;
    font-size: 0.85em;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.condition-value {
    font-weight: bold;
    color: #d4d4d4;
}

.bets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.bet-card {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 0;
    border: 1px solid #2a2a2a;
    position: relative;
}

.bet-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3a3a3a, transparent);
}

.bet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.bet-user {
    font-weight: bold;
    color: #d4d4d4;
    font-family: 'Cinzel', serif;
}

.bet-amount {
    font-weight: bold;
    color: #999;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

.bet-prediction {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #d4d4d4;
}

.bet-condition {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.bet-image {
    margin-top: 15px;
    margin-bottom: 15px;
}

.bet-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #2a2a2a;
    display: block;
}

.agreement-section {
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    padding: 20px;
    margin-bottom: 20px;
}

.agreement-section h3 {
    font-family: 'Cinzel', serif;
    color: #d4d4d4;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.agreement-content {
    color: #999;
    line-height: 1.8;
    white-space: pre-wrap;
    font-style: italic;
    border-top: 1px solid #2a2a2a;
    padding-top: 15px;
    margin-top: 15px;
}

.agreement-content:empty::before {
    content: 'לא הוגדר הסכם עדיין';
    color: #666;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    background-color: #1a1a1a;
    border: 1px solid #3a3a3a;
    margin: 5% auto;
    padding: 30px;
    border-radius: 0;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #666;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 20px;
    transition: color 0.3s;
}

.close:hover {
    color: #d4d4d4;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #e8e8e8;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.8em;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.form-row-inline .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

.form-row-inline .form-group-text {
    min-width: 180px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group-inline label {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.form-group-inline input {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #d4d4d4;
    font-weight: bold;
    font-family: 'Cinzel', serif;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    font-size: 1em;
    font-family: 'Crimson Text', serif;
    background: #0f0f0f;
    color: #d4d4d4;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a4a4a;
    background: #151515;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.form-hint {
    color: #666;
    font-size: 0.9em;
    margin: -10px 0 15px;
    font-style: italic;
}

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-label {
    display: block;
    padding: 12px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    color: #d4d4d4;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    font-family: 'Cinzel', serif;
}

.file-upload-label:hover {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.image-preview {
    margin-top: 15px;
    max-width: 100%;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #2a2a2a;
    display: block;
}

.payment-result {
    text-align: center;
    padding: 60px 20px;
}

.payment-result h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-family: 'Cinzel', serif;
}

.payment-result.success h1 {
    color: #999;
}

.payment-result.error h1 {
    color: #666;
}

.payment-result.warning h1 {
    color: #666;
}

.payment-result p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    .rooms-grid,
    .conditions-list,
    .bets-list {
        grid-template-columns: 1fr;
    }

    .guess-row {
        grid-template-columns: 1fr 1fr;
    }

    .guess-row .guess-prediction {
        grid-column: 1 / -1;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}
