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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fafbfc;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    color: #1a1a2e;
    margin-bottom: 40px;
    text-align: center;
    font-size: 2.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #2d3748;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Boss Configuration Card */
.input-section > div:first-child {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.form-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    align-items: start;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    background: white;
    margin-top: 6px;
}

input[type="number"] {
    font-family: 'Monaco', 'Courier New', monospace;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input:hover {
    border-color: #cbd5e0;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    margin: 40px auto;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.btn-calculate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.results-section {
    margin-top: 40px;
}

.result-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    animation: slideIn 0.4s ease;
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.stat-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.stat-item:hover {
    background: #edf2f7;
    transform: translateX(3px);
}

.stat-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Monaco', 'Courier New', monospace;
    margin-top: 4px;
    word-break: break-all;
}

.victory {
    color: #28a745;
    font-weight: bold;
}

.defeat {
    color: #dc3545;
    font-weight: bold;
}

.error {
    background: #fff5f5;
    color: #c53030;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #fc8181;
    border-left: 4px solid #dc3545;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
    font-weight: 500;
}

.section-header {
    margin-top: 30px;
}

.btn-add {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-add:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-right: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.form-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    animation: slideIn 0.3s ease;
}

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

.form-card h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.form-card h4 {
    color: #4a5568;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

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

.item-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 0;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.item-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 17px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.item-stats {
    font-size: 13px;
    color: #718096;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.item-stat {
    display: inline-flex;
    background: #f7fafc;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.btn-edit {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 6px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:hover {
    border-color: #cbd5e0;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #a0aec0;
    font-style: italic;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

#bossCustomFields {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #e2e8f0;
    transition: all 0.3s ease;
}

/* Progress bar styling */
#progressBar {
    position: relative;
    overflow: hidden;
}

#progressBar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Toast Notifications */
.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

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

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

.toast.info {
    border-left-color: #667eea;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #718096;
}

.toast-close {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #cbd5e0;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.tooltip:hover .tooltip-icon {
    background: #667eea;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 10000;
    background: #2d3748;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    width: 250px;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Settings Menu */
.settings-menu {
    position: relative;
    display: inline-block;
}

.settings-button {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-button:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
}

.settings-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
    display: none;
    animation: slideDown 0.2s ease;
}

.settings-dropdown.show {
    display: block;
}

.settings-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
}

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

.settings-item:hover {
    background: #f7fafc;
    color: #667eea;
}

.settings-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

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