/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    line-height: 1.6;
}

/* Layout */
.page {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #16213e;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.8rem;
    color: #f7931a;
    margin-bottom: 6px;
    white-space: nowrap;
}

.login-box h2 {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #ccc;
}

.login-box h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #eee;
}

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

.form-section p {
    margin-bottom: 20px;
    color: #ccc;
}

/* Header */
.header {
    background: #16213e;
    border-bottom: 1px solid #333;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0;
}

.header h1 {
    color: #f7931a;
    font-size: 1.8rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Navigation */
.nav {
    background: #0f1626;
    border-bottom: 1px solid #333;
    padding: 0 20px;
}

.nav {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-btn {
    background: none;
    border: none;
    color: #ccc;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-btn:hover {
    color: #f7931a;
    background: rgba(247, 147, 26, 0.1);
}

.nav-btn.active {
    color: #f7931a;
    border-bottom-color: #f7931a;
}

/* Main content */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.content-header h2 {
    color: #eee;
    font-size: 1.8rem;
}

/* Cards and grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #333;
}

.stat-card h3 {
    color: #ccc;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #f7931a;
}

.stat-value.btc::after {
    content: " BTC";
    font-size: 1rem;
    color: #ccc;
}

.stat-value.usd::before {
    content: "$";
}

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

.event-card {
    background: #16213e;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s;
}

.event-card:hover {
    border-color: #f7931a;
    transform: translateY(-2px);
}

.event-card h3 {
    color: #f7931a;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.event-date {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.event-description {
    color: #eee;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.event-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #ccc;
}

.event-social {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.social-icon.telegram {
    background: #0088cc;
    color: white;
}

.social-icon.x {
    background: #000;
    color: white;
}

.social-icon.inactive {
    background: #333;
    color: #666;
}

/* Forms */
form {
    margin-bottom: 20px;
}

.event-form {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 30px;
}

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

.form-row input,
.form-row textarea,
.form-row select {
    flex: 1;
    min-width: 200px;
    background: #0f1626;
    border: 1px solid #333;
    color: #eee;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #f7931a;
}

.form-row textarea {
    min-width: 100%;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    min-width: auto;
}

/* Buttons */
button {
    background: #f7931a;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

button:hover {
    background: #e8850f;
    transform: translateY(-1px);
}

.primary-btn {
    background: #f7931a;
}

.secondary-btn {
    background: #333;
    color: #eee;
}

.secondary-btn:hover {
    background: #444;
}

.danger-btn {
    background: #dc3545;
}

.danger-btn:hover {
    background: #c82333;
}

.link-btn {
    background: none;
    color: #f7931a;
    text-decoration: underline;
    padding: 5px 10px;
}

.link-btn:hover {
    background: rgba(247, 147, 26, 0.1);
    transform: none;
}

/* Photos */
.event-photos {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
}

.event-photos h3 {
    margin-bottom: 20px;
    color: #eee;
}

.photo-upload {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.photo-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Finances */
.balance-section {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 30px;
}

.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.balance-card {
    background: #0f1626;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
}

.balance-card h4 {
    color: #ccc;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.balance-card input {
    width: 100%;
    background: #1a1a2e;
    border: 1px solid #333;
    color: #f7931a;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
}

.transaction-section {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
}

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

.transaction-form {
    background: #0f1626;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
    margin-bottom: 25px;
}

.transaction-form h4 {
    margin-bottom: 20px;
    color: #eee;
}

.form-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.transactions-table {
    overflow-x: auto;
}

.transaction-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 20px;
    padding: 15px;
    background: #0f1626;
    border-radius: 6px;
    border: 1px solid #333;
    margin-bottom: 10px;
    align-items: center;
}

.transaction-item:hover {
    border-color: #f7931a;
}

.tx-date {
    color: #ccc;
    font-size: 0.9rem;
    white-space: nowrap;
}

.tx-description {
    color: #eee;
}

.tx-amount {
    font-weight: bold;
    white-space: nowrap;
}

.tx-amount.income {
    color: #28a745;
}

.tx-amount.expense {
    color: #dc3545;
}

.tx-currency {
    color: #ccc;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.tx-type {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tx-type.income {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.tx-type.expense {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Activity list */
.activity-list {
    background: #16213e;
    border-radius: 8px;
    border: 1px solid #333;
}

.activity-item {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-info h4 {
    color: #eee;
    margin-bottom: 5px;
}

.activity-info p {
    color: #ccc;
    font-size: 0.9rem;
}

.activity-date {
    color: #ccc;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #f7931a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background: #16213e;
    color: #eee;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #f7931a;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 0;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .main {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row input,
    .form-row textarea,
    .form-row select {
        min-width: 100%;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .transaction-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: left;
    }
    
    .balance-cards {
        grid-template-columns: 1fr;
    }
    
    .photo-upload {
        flex-direction: column;
        align-items: stretch;
    }
    
    .photo-upload input[type="file"] {
        min-width: 100%;
    }
}
/* Stacked login forms */
.stacked-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stacked-form input {
    width: 100%;
}

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

/* Dashboard events table */
.dashboard-events-section {
    margin-top: 30px;
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
}

.dashboard-events-section h3 {
    color: #f7931a;
    margin-bottom: 15px;
}

.events-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.events-table-header {
    display: grid;
    grid-template-columns: 100px 1fr 150px 120px 80px 80px;
    align-items: center;
    padding: 12px 16px;
    background: #0f1626;
    border-radius: 6px;
    gap: 12px;
    font-weight: 600;
    color: #f7931a;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.events-table-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-row {
    display: grid;
    grid-template-columns: 100px 1fr 150px 120px 80px 80px;
    align-items: center;
    padding: 12px 16px;
    background: #1a1a2e;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.event-row:hover {
    background: #2a2a4e;
}

.event-row-date {
    color: #999;
    font-size: 0.85rem;
    white-space: nowrap;
}

.event-row-title {
    font-weight: 600;
    color: #eee;
}

.event-row-venue {
    color: #888;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-row-social {
    display: flex;
    gap: 6px;
    align-items: center;
}

.progress-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.progress-dot.completed {
    background: #28a745;
}

.progress-dot.pending {
    background: #dc3545;
}

.progress-dot.na {
    background: #6c757d;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-badge.posted {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-badge.not-posted {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.event-row-rsvp,
.event-row-attended {
    font-size: 0.85rem;
    color: #ccc;
    text-align: center;
}

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

/* Marketing Graphic */
.event-marketing-graphic {
    background: #16213e;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 20px;
}

.event-marketing-graphic h3 {
    margin-bottom: 20px;
    color: #eee;
}

.graphic-upload {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.graphic-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.current-graphic {
    text-align: center;
}

.current-graphic img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid #333;
}

.current-graphic .no-graphic {
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* New venue form */
#new-venue-form {
    border: 1px solid #f7931a;
    border-radius: 6px;
    padding: 15px;
    background: rgba(247, 147, 26, 0.05);
}

/* Mobile responsive event rows */
@media (max-width: 768px) {
    .events-table-header,
    .event-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .events-table-header {
        display: none; /* Hide header on mobile */
    }
    
    .event-row {
        padding: 16px;
    }
    
    .event-row-date {
        font-size: 0.75rem;
        font-weight: bold;
        color: #f7931a;
    }
    
    .event-row-social,
    .event-row-rsvp,
    .event-row-attended {
        font-size: 0.75rem;
    }
}

/* Treasury card */
.finance-card {
    grid-column: span 1;
}

.treasury-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.treasury-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.treasury-row.total {
    font-weight: 700;
    font-size: 1.1rem;
}

.treasury-label {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    min-width: 36px;
}

.treasury-value {
    color: #eee;
    font-size: 1rem;
    font-weight: 600;
}

.treasury-value.btc {
    color: #f7931a;
}

.treasury-sub {
    color: #666;
    font-size: 0.8rem;
}

.treasury-divider {
    border-top: 1px solid #333;
    margin: 4px 0;
}

/* Venue search autocomplete */
.new-venue-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 12px;
    background: #1a1a2e;
    border-radius: 8px;
}

.venue-search-container {
    position: relative;
}

.venue-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #16213e;
    border: 1px solid #444;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.venue-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #2a2a4e;
    transition: background 0.1s;
}

.venue-suggestion-item:last-child {
    border-bottom: none;
}

.venue-suggestion-item:hover {
    background: #2a2a4e;
}

.venue-suggestion-item strong {
    color: #eee;
    font-size: 0.9rem;
}

.venue-suggestion-item span {
    color: #888;
    font-size: 0.8rem;
}

/* Logo */
.login-logo {
    width: 200px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
}

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

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
}

/* Venue selected display */
.venue-selected-details {
    background: #2a2a4e;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.venue-detail-name {
    font-weight: 600;
    color: #eee;
    font-size: 0.9rem;
}

.venue-detail-address {
    color: #888;
    font-size: 0.8rem;
    flex: 1;
}

.venue-selected-details .link-btn {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.venue-input {
    width: 100% !important;
}

/* Organizer attendance */
.organizer-section {
    margin-top: 24px;
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
}

.organizer-section h3 {
    color: #f7931a;
    margin-bottom: 12px;
}

.organizer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.organizer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a1a2e;
    border-radius: 6px;
}

.organizer-name {
    font-weight: 500;
    color: #eee;
}

.organizer-buttons {
    display: flex;
    gap: 8px;
}

.org-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid #444;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.org-btn:hover {
    border-color: #666;
    color: #eee;
}

.org-btn.active-yes {
    background: #1a3d1a;
    border-color: #2a6e2a;
    color: #6fdc6f;
}

.org-btn.active-no {
    background: #3d1a1a;
    border-color: #6e2a2a;
    color: #dc6f6f;
}

.organizer-status {
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.organizer-status.status-yes {
    color: #6fdc6f;
    background: #1a3d1a;
}

.organizer-status.status-no {
    color: #dc6f6f;
    background: #3d1a1a;
}

.organizer-status.status-unknown {
    color: #999;
    background: #2a2a3e;
}

.organizer-warning {
    background: #3d3a1a;
    color: #dcd06f;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* Input groups with labels */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.input-group label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Spend gap indicator */
.spend-gap {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 4px;
}

.spend-gap.shortfall {
    background: #3d2a1a;
    color: #dca06f;
}

.spend-gap.surplus, .spend-gap.met {
    background: #1a3d1a;
    color: #6fdc6f;
}

.spend-gap.pending {
    background: #2a2a3e;
    color: #999;
}
