* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    position: relative;
    overflow-x: hidden;
}

/* Анимированный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(100, 219, 222, 0.2) 0%, transparent 50%);
    z-index: -1;
}

.main-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 1;
}

/* Компактный аудиоплеер */
.player-section.compact-player {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 219, 222, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    min-height: 90px;
}

.player-section.compact-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00dbde, #fc00ff);
    z-index: 2;
}

.player-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.player-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #00dbde;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 219, 222, 0.5);
}

.player-title i {
    font-size: 1rem;
}

.track-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.player-status {
    font-size: 0.7rem;
    color: #aaa;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 219, 222, 0.2);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.control-btn.small-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.control-btn.small-btn:hover {
    background: rgba(0, 219, 222, 0.2);
    border-color: #00dbde;
    transform: translateY(-1px);
}

.play-btn.small-play-btn {
    background: linear-gradient(135deg, #00dbde, #fc00ff);
    border: none;
    width: 36px;
    height: 36px;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(0, 219, 222, 0.3);
    flex-shrink: 0;
}

.play-btn.small-play-btn:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 219, 222, 0.5);
}

.volume-control-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.volume-icon-small {
    font-size: 14px;
    color: #00dbde;
    width: 16px;
    flex-shrink: 0;
}

.volume-slider-small {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    min-width: 50px;
}

.volume-slider-small::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00dbde, #fc00ff);
    cursor: pointer;
    border: 2px solid #fff;
}

.volume-slider-small::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00dbde, #fc00ff);
    cursor: pointer;
    border: 2px solid #fff;
}

.volume-value-small {
    width: 35px;
    text-align: center;
    font-size: 0.75rem;
    color: #00dbde;
    font-weight: 600;
    flex-shrink: 0;
}

.player-progress-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.time-display-small {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.65rem;
    color: #aaa;
    width: 45px;
    flex-shrink: 0;
}

.progress-container-small {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-small {
    width: 100%;
    height: 100%;
    position: relative;
}

.progress-small {
    height: 100%;
    background: linear-gradient(90deg, #00dbde, #fc00ff);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 2px;
}

.track-counter-small {
    font-size: 0.7rem;
    color: #aaa;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(252, 0, 255, 0.2);
    flex-shrink: 0;
}

.track-counter-small span:first-child {
    color: #fc00ff;
    font-weight: 600;
}

/* Секция журнала сделок */
.journal-section {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(252, 0, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.journal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #fc00ff, #00dbde);
    z-index: 2;
}

.journal-header {
    margin-bottom: 15px;
}

.journal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fc00ff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 8px rgba(252, 0, 255, 0.5);
    margin-bottom: 12px;
}

.summary-cards {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.summary-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 60px;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.total-card {
    border-top: 2px solid #4caf50;
}

.positive-card {
    border-top: 2px solid #00dbde;
}

.negative-card {
    border-top: 2px solid #ff9800;
}

.summary-label {
    font-size: 0.7rem;
    color: #aaa;
    margin-bottom: 4px;
    text-align: center;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.total-card .summary-value {
    color: #4caf50;
}

.positive-card .summary-value {
    color: #00dbde;
}

.negative-card .summary-value {
    color: #ff9800;
}

/* Таблица */
.table-container {
    max-height: 280px;
    overflow-y: auto;
    margin: 12px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.table-container::-webkit-scrollbar {
    width: 5px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00dbde, #fc00ff);
    border-radius: 3px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

thead tr {
    background: linear-gradient(135deg, rgba(0, 219, 222, 0.15), rgba(252, 0, 255, 0.15));
    backdrop-filter: blur(8px);
}

th {
    padding: 10px 6px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(252, 0, 255, 0.4);
    position: relative;
    white-space: nowrap;
    font-size: 0.8rem;
}

th i {
    margin-right: 5px;
    color: #00dbde;
    font-size: 0.9rem;
}

td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

tbody tr {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
    background: rgba(0, 219, 222, 0.08);
}

.col-time {
    width: 20%;
}

.col-pair {
    width: 25%;
}

.col-amount {
    width: 25%;
}

.col-emotion {
    width: 30%;
}

input, select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #00dbde;
    box-shadow: 0 0 0 2px rgba(0, 219, 222, 0.15);
    background: rgba(0, 0, 0, 0.4);
}

input.amount-positive {
    color: #4caf50;
    font-weight: 600;
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.2);
}

input.amount-negative {
    color: #ff9800;
    font-weight: 600;
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.2);
}

select {
    cursor: pointer;
    padding: 6px 6px;
    font-size: 0.75rem;
}

/* Панель управления */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.control-button {
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.control-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.control-button:hover::before {
    left: 100%;
}

.add-button {
    background: linear-gradient(135deg, #00dbde, #2196f3);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 219, 222, 0.25);
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 219, 222, 0.35);
}

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

.export-button {
    flex: 1;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.25);
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.35);
}

.print-button {
    flex: 1;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.25);
}

.print-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.35);
}

.clear-button {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 3px 10px rgba(244, 67, 54, 0.25);
}

.clear-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.35);
}

/* Футер */
.app-footer {
    text-align: center;
    padding: 10px;
    color: #777;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 5px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-section, .journal-section {
    animation: fadeIn 0.4s ease-out;
}

/* Эффект пульсации для кнопки воспроизведения */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 219, 222, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(0, 219, 222, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 219, 222, 0); }
}

.play-btn.small-play-btn.playing {
    animation: pulse 1.5s infinite;
}

/* Адаптивность */
@media (max-width: 420px) {
    body {
        padding: 10px;
    }
    
    .main-container {
        max-width: 100%;
        gap: 12px;
    }
    
    .player-section.compact-player {
        padding: 8px 12px;
        min-height: 85px;
    }
    
    .journal-section {
        padding: 12px;
    }
    
    .summary-cards {
        flex-direction: column;
        gap: 6px;
    }
    
    .summary-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        min-height: 50px;
    }
    
    .summary-label {
        margin-bottom: 0;
        font-size: 0.75rem;
    }
    
    .summary-value {
        font-size: 1rem;
    }
    
    .export-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .control-button {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 7px 5px;
    }
    
    th i {
        font-size: 0.8rem;
        margin-right: 4px;
    }
    
    input, select {
        padding: 5px 6px;
        font-size: 0.75rem;
    }
    
    .track-name {
        max-width: 150px;
    }
    
    .volume-slider-small {
        min-width: 40px;
    }
}

/* Мобильная ориентация */
@media (max-height: 700px) {
    .table-container {
        max-height: 220px;
    }
    
    .player-section.compact-player {
        min-height: 80px;
    }
    
    .player-controls {
        margin-bottom: 3px;
    }
    
    .player-progress-compact {
        margin-top: 2px;
    }
}