/* Settings Modal Base */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Container */
.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(30px) scale(0.9);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.modal-header:hover::before {
    left: 100%;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Close Button */
.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    background: #fafafa;
}

/* Form Styles */
.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    transform: translateY(-1px);
}

.modal-body textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.save-btn,
.upload-btn,
.modal-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.save-btn:hover,
.upload-btn:hover,
.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.save-btn:active,
.upload-btn:active,
.modal-btn:active {
    transform: translateY(0);
}

/* Secondary Button */
.secondary-btn {
    background: #6b7280;
    margin-left: 0.5rem;
}

.secondary-btn:hover {
    background: #4b5563;
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

/* Profile Pic Upload Section */
.profile-pic-upload {
    text-align: center;
    padding: 1rem 0;
}

.current-pic {
    margin-bottom: 1.5rem;
}

.current-pic img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ff6b6b;
    margin-bottom: 1rem;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.current-pic img:hover {
    transform: scale(1.05);
}

.upload-preview {
    max-width: 120px;
    max-height: 120px;
    border-radius: 50%;
    border: 4px solid #ff6b6b;
    margin: 1rem auto;
    display: none;
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 1rem 0;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Bio Edit Section */
.bio-edit,
.username-edit,
.password-edit {
    padding: 0.5rem 0;
}

.bio-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: -1rem;
    margin-bottom: 1rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak { background: #ef4444; width: 25%; }
.strength-fair { background: #f59e0b; width: 50%; }
.strength-good { background: #10b981; width: 75%; }
.strength-strong { background: #059669; width: 100%; }

.strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Error States */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Success States */
.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.success-message {
    color: #10b981;
    font-size: 0.8rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.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 Modal Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .current-pic img {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        border-radius: 15px;
    }

    .modal-header {
        padding: 1rem;
        border-radius: 15px 15px 0 0;
    }

    .modal-body {
        padding: 1rem;
    }

    .save-btn,
    .upload-btn,
    .modal-btn {
        width: 100%;
        margin-top: 1rem;
    }

    .secondary-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Animation für Modal Entrance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff5252, #ff9500);
}