/* Üldised stiilid */
:root {
    --primary-color: #2c3e50;
    --earn-color: #27ae60;
    --spend-color: #e74c3c;
    --bg-color: #f5f6fa;
    --text-color: #2c3e50;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Konteiner */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Päis */
header {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Põhisisu paigutus */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Bilansi sektsioon */
.balance-section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.big-balance {
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    margin: 30px 0;
    font-family: monospace;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.big-balance.positive {
    color: var(--earn-color);
}

.big-balance.negative {
    color: var(--spend-color);
}

.debt-warning {
    background-color: #fff3cd;
    color: var(--spend-color);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
    border: 2px solid var(--spend-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Taimerite sektsioon */
.timers-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
}

/* Sektsioonid */
.section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: calc(50% - 15px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.earn {
    border-top: 5px solid var(--earn-color);
}

.spend {
    border-top: 5px solid var(--spend-color);
}

/* Taimer */
.timer {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    font-family: monospace;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Nupud */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.earn .start-btn {
    background-color: var(--earn-color);
    color: white;
}

.earn .stop-btn {
    background-color: #c0392b;
    color: white;
}

.spend .start-btn {
    background-color: var(--spend-color);
    color: white;
}

.spend .stop-btn {
    background-color: #c0392b;
    color: white;
}

.spend .turbo-btn {
    background-color: #8e44ad;
    color: white;
}

.spend .turbo-btn:hover:not(:disabled) {
    background-color: #9b59b6;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tehingute ajalugu */
.transactions-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
}

.transaction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #ddd;
}

.transaction.earn {
    border-left-color: var(--earn-color);
}

.transaction.spend {
    border-left-color: var(--spend-color);
}

.transaction .time {
    color: #666;
    font-size: 0.9rem;
}

.transaction .type {
    font-weight: bold;
}

.transaction.earn .type {
    color: var(--earn-color);
}

.transaction.spend .type {
    color: var(--spend-color);
}

.transaction .amount {
    text-align: right;
    margin-left: auto;
    font-weight: bold;
    font-family: monospace;
}

/* Daemon oleku indikaatorid */
.daemon-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

.status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status.active {
    background-color: var(--earn-color);
    color: white;
}

.status.inactive {
    background-color: var(--spend-color);
    color: white;
}

.daemon-warning {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.logout-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Mobiilne vaade */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .big-balance {
        font-size: 3rem;
    }

    .transactions-list {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    header {
        text-align: center;
    }
    
    .daemon-status {
        width: 100%;
        margin: 15px 0;
    }
    
    .status {
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }

    .transaction {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

.header-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.admin-btn {
    background-color: #6c757d;
}

.admin-btn:hover {
    background-color: #5a6268;
}

.logout-btn {
    background-color: var(--spend-color);
}

.logout-btn:hover {
    background-color: #c82333;
} 