/**
 * Message display styles for Klanginstanz Chart System
 */

/* Reset body margin globally */
body {
    margin: 0 !important;
}

/* Message Display Styles */
.form-messages {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    display: none;
}

.form-messages.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-messages.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.form-messages.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.form-messages.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.form-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.form-message-content {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.form-message-content small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.close-message {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    opacity: 0.7;
}

.close-message:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.1);
}

.form-messages.show {
    display: block !important;
    animation: slideDown 0.3s ease;
}

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

/* Form validation styles */
.form-group.error input {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group.error label {
    color: #e74c3c;
}

.form-group.success input {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group.success label {
    color: #27ae60;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-messages {
        margin: 15px 0;
        padding: 12px;
    }
    
    .form-message-content {
        font-size: 13px;
    }
    
    .close-message {
        width: 18px;
        height: 18px;
        font-size: 16px;
    }
}
