/* Główne style */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: #212121;
    color: white;
    padding: 20px;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo {
    height: 60px;
    width: auto;
}

h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

h2 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 22px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

h3 {
    color: #555;
    font-size: 18px;
    margin: 15px 0;
}

/* Panel logowania */
.panel {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

input:focus, select:focus {
    border-color: #00A3E0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn i {
    font-size: 16px;
}

.btn.primary {
    background: linear-gradient(135deg, #00A3E0, #0078D4);
    color: white;
}

.btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #0078D4, #00A3E0);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 120, 212, 0.2);
}

.btn.secondary:hover {
    background: #e5e5e5;
    transform: translateY(-2px);
}

.btn.logout {
    background: transparent;
    color: #777;
    padding: 8px;
    margin-left: auto;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    min-height: 20px;
}

.verification-content {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.success-message {
    padding: 15px;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    color: #28a745;
    text-align: center;
}

.success-message i {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message {
    padding: 15px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    color: #dc3545;
    text-align: center;
}

.error-message i {
    font-size: 48px;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 20px;
}

.loading i {
    font-size: 24px;
    margin-right: 10px;
    color: #00A3E0;
}

/* Zakładki */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #777;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    width: auto;
}

.tab-btn.active {
    color: #FF6B00;
    border-bottom-color: #FF6B00;
    background: rgba(255, 107, 0, 0.05);
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
    color: #555;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Formularze w zakładkach */
.form-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

/* Ikonki emocji */
.emotion-selector {
    margin: 20px 0;
}

.emotion-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.emotion-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    border: 2px solid #eee;
    width: 80px;
}

.emotion-icon i {
    font-size: 30px;
    margin-bottom: 8px;
    color: #777;
}

.emotion-icon span {
    font-size: 14px;
    color: #555;
}

.emotion-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.emotion-icon.selected {
    border-color: #ff416c;
    background: rgba(255, 65, 108, 0.05);
}

.emotion-icon.selected i {
    color: #ff416c;
}

/* Ikony emocji */
.emotion-icon[data-value="wesoly"] i { color: #ffc107; }
.emotion-icon[data-value="pozytywny"] i { color: #4caf50; }
.emotion-icon[data-value="neutralny"] i { color: #9e9e9e; }
.emotion-icon[data-value="poddenerwowany"] i { color: #ff9800; }
.emotion-icon[data-value="wkurw"] i { color: #f44336; }
.emotion-icon[data-value="smutny"] i { color: #2196f3; }
.emotion-icon[data-value="zaniepokojony"] i { color: #9c27b0; }

/* Checkbox */
.checkbox-group {
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

/* Lista osób */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.person-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.add-person-card {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px;
}

.add-person-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.add-person-content i {
    font-size: 32px;
    color: #00A3E0;
}

.add-person-content h3 {
    margin: 0;
    color: #333;
}

.person-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.person-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.person-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.person-meta span {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.person-meta i {
    margin-right: 5px;
    color: #4caf50;
}

.person-prediction {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.person-prediction h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #555;
    display: flex;
    align-items: center;
}

.person-prediction h4 i {
    margin-right: 8px;
    color: #2196f3;
}

.prediction-display {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.prediction-date {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-style: italic;
}

.prediction-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.prediction-content i {
    font-size: 24px;
}

.loading-small {
    color: #757575;
}

.loading-small i {
    font-size: 18px;
}

.prediction-error {
    color: #f44336;
}

.prediction-unknown {
    color: #9e9e9e;
}

.prediction-period-badge {
    background: #ff9800;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.person-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

/* Historia */
.history-container {
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    padding: 20px;
}

.history-timeline {
    position: relative;
    padding-left: 30px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #eee;
}

.history-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.history-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
}

.history-date {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.history-emotion {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-emotion i {
    font-size: 20px;
}

/* Predykcje */
.prediction-result {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.prediction-emotion {
    font-size: 24px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.prediction-emotion i {
    font-size: 36px;
}

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

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
}

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

.modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close-modal {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

/* Pole daty */
.date-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Przyciski akcji */
.btn.danger {
    background: #f44336;
    color: white;
}

.btn.danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(244, 67, 54, 0.2);
}

/* Akcje w historii */
.history-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.history-actions button {
    padding: 5px 10px;
    font-size: 12px;
}

.period-badge {
    background: #ff9800;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Wykresy */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chart-options {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-wrapper {
    width: 100%;
    height: 300px;
    position: relative;
    margin-bottom: 20px;
}

/* Podpowiedzi */
.checkbox-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-left: 25px;
}

/* Opcje predykcji */
.prediction-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.prediction-details {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.prediction-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.prediction-details ul {
    margin: 0;
    padding-left: 20px;
}

.prediction-details li {
    margin-bottom: 5px;
}

.prediction-period {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    background: #ff9800;
    color: white;
}

.prediction-model {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    background: #2196f3;
    color: white;
}

/* Responsywność */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .emotion-icons {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .chart-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

/* Zakładki z osobami */
.partner-tabs-container {
    margin-bottom: 30px;
}

.partner-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.partner-tab {
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.partner-tab:hover {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.partner-tab.active {
    background-color: #4caf50;
    color: white;
    border-color: #2e7d32;
}

.partner-tab i {
    margin-right: 8px;
    font-size: 16px;
}

.history-content {
    display: none;
}

.no-partner-selected {
    background-color: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    color: #757575;
}

.no-partner-selected i {
    font-size: 24px;
    margin-right: 10px;
    color: #2196f3;
}

/* Komunikaty */
.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: fadeInOut 3s ease-in-out;
}

.success-message i {
    font-size: 24px;
    margin-right: 10px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Stylizacja listy historii stanów */
#partner-states {
    margin-top: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    transition: background-color 0.3s;
}

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

.history-item:hover {
    background-color: #f9f9f9;
}

.history-date {
    font-weight: 500;
    color: #555;
    flex-basis: 120px; /* Stała szerokość dla daty */
    flex-shrink: 0;
}

.history-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1; /* Pozwala zawartości zająć dostępne miejsce */
    margin: 0 15px; /* Odstępy po bokach */
}

.history-content i {
    font-size: 20px;
    width: 25px; /* Stała szerokość dla ikony */
    text-align: center;
}

.history-content span {
    color: #333;
}

.period-badge {
    background-color: #e91e63;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    white-space: nowrap;
}

.period-badge i {
    font-size: 10px;
    margin-right: 4px;
    color: white !important; /* Nadpisanie koloru z .history-content i */
    width: auto !important; /* Nadpisanie szerokości */
}

.history-actions {
    flex-shrink: 0; /* Zapobiega zmniejszaniu się kontenera z przyciskiem */
}

.history-actions .btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.history-actions .btn.small i {
    font-size: 12px;
}
