/* Tooltip styles for help text */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.3;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Animation for results appearing */
.results-section {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error message styling */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

/* Success message styling */
.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} D&D 5e HP Calculator Styles */

.dnd-calculator-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 2px solid #8B4513;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-family: 'Georgia', serif;
}

.dnd-calculator-container h3 {
    color: #8B4513;
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.calculator-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
}

/* Constitution modifier display */
#con-modifier {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background: #8B4513;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* Multiclass styles */
.class-level-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.class-level-row select,
.class-level-row input {
    flex: 1;
    min-width: 120px;
}

.class-level-row button {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.class-level-row button:hover {
    background: #c82333;
}

/* Main action buttons */
#calculate-hp,
button[onclick*="calculateMonsterHP"],
button[onclick*="addClassLevel"] {
    background: #8B4513;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#calculate-hp:hover,
button[onclick*="calculateMonsterHP"]:hover,
button[onclick*="addClassLevel"]:hover {
    background: #A0522D;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/* Results section */
.results-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.results-section h4,
.results-section h5 {
    color: #8B4513;
    margin-top: 0;
    margin-bottom: 15px;
}

.total-hp {
    font-size: 20px;
    color: #8B4513;
    text-align: center;
    padding: 15px;
    background: white;
    border: 2px solid #8B4513;
    border-radius: 6px;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#hp-breakdown ul {
    list-style-type: none;
    padding: 0;
}

#hp-breakdown li {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border-left: 4px solid #8B4513;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Monster calculator specific styles */
#monster-hp-breakdown p {
    margin: 10px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

#monster-hp-breakdown strong {
    color: #8B4513;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px;
    transform: scale(1.2);
}

input[type="checkbox"] + label,
label:has(input[type="checkbox"]) {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    color: #8B4513;
}

/* Responsive design */
@media (max-width: 768px) {
    .dnd-calculator-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .class-level-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .class-level-row select,
    .class-level-row input,
    .class-level-row button {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/*