/* Profile Background Customization Styles */

/* Form styling for dark theme */
.profile-form .form-group {
    margin-bottom: 25px;
}

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

.profile-form input[type="text"],
.profile-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background-color: rgba(18, 18, 35, 0.9);
    border: 1px solid rgba(180, 180, 180, 0.3);
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.profile-form input[type="text"]:focus,
.profile-form textarea:focus {
    border-color: rgba(200, 200, 200, 0.8);
    box-shadow: 0 0 10px rgba(150, 150, 150, 0.4);
    outline: none;
}

.profile-form textarea {
    resize: vertical;
    min-height: 100px;
}

.profile-form small {
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.85rem;
    margin-top: 5px;
    display: inline-block;
}

/* Background options */
.background-options {
    margin-top: 15px;
    border-radius: 8px;
    background-color: rgba(30, 30, 45, 0.8);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.option {
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(180, 180, 180, 0.3);
}

.option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #e0e0e0;
}

.option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(180, 180, 180, 0.6);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    background: rgba(30, 30, 45, 0.8);
}

.option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #dddddd;
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.6);
}

.gradient-selector, .image-selector {
    margin-top: 10px;
    padding: 15px;
    background-color: rgba(18, 18, 35, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(180, 180, 180, 0.2);
}

/* Preset gradients */
.preset-gradients {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.preset {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.preset::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transition: opacity 0.3s ease;
}

.preset:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.preset:hover::after {
    opacity: 1;
}

.preset.active {
    border: 2px solid #dddddd;
    box-shadow: 0 0 12px rgba(200, 200, 200, 0.6);
}

/* Current background preview */
.current-bg-preview {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.current-bg-preview p {
    color: #dddddd;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.current-bg-preview img {
    margin-top: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(180, 180, 180, 0.3);
}

/* Profile container and title styling */
.profile-container {
    background-color: rgba(30, 30, 45, 0.8);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-container h1 {
    margin-bottom: 25px;
    font-weight: 600;
    color: #e0e0e0;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.profile-container h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, rgba(150, 150, 150, 0.8), rgba(220, 220, 220, 0.8));
    border-radius: 2px;
}

/* Profile view background styling */
.profile-container.with-background {
    position: relative;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
}

/* Background image styling */
.profile-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.profile-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark fade gradient overlay */
.profile-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}

/* Adjust profile content for backgrounds */
.with-background .profile-header, 
.with-background .profile-content {
    position: relative;
    color: #fff;
}

.with-background .profile-header {
    padding: 30px 20px 20px;
}

.with-background .profile-content {
    padding: 20px;
    background-color: rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    margin: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Improved visibility for text */
.with-background h1, 
.with-background h2,
.with-background p {
    text-shadow: 0px 1px 3px rgba(0,0,0,0.5);
}

/* Gradient selector text field and file inputs */
#profileBackgroundGradient {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background-color: rgba(18, 18, 35, 0.9);
    border: 1px solid rgba(180, 180, 180, 0.3);
    color: #e0e0e0;
    margin-bottom: 10px;
    font-family: 'Lexend', monospace;
    transition: all 0.3s ease;
}

#profileBackgroundGradient:focus {
    border-color: rgba(200, 200, 200, 0.8);
    box-shadow: 0 0 10px rgba(180, 180, 180, 0.4);
    outline: none;
}

/* Custom file input styling */
.profile-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.current-profile-image {
    margin-bottom: 15px;
    position: relative;
}

.current-profile-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(180, 180, 180, 0.6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.current-profile-image img:hover {
    transform: scale(1.05);
    border-color: rgba(200, 200, 200, 0.8);
    box-shadow: 0 8px 20px rgba(150, 150, 150, 0.4);
}

.profile-image-upload input[type="file"],
.image-selector input[type="file"] {
    width: 100%;
    font-size: 0.9rem;
    color: #e0e0e0;
    background-color: rgba(18, 18, 35, 0.9);
    border: 1px solid rgba(180, 180, 180, 0.3);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    max-width: 400px;
}

.profile-image-upload input[type="file"]::-webkit-file-upload-button,
.image-selector input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, rgba(120, 120, 120, 0.8), rgba(180, 180, 180, 0.8));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-image-upload input[type="file"]::-webkit-file-upload-button:hover,
.image-selector input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, rgba(150, 150, 150, 0.9), rgba(200, 200, 200, 0.9));
    box-shadow: 0 0 8px rgba(180, 180, 180, 0.5);
}

.image-selector small {
    display: block;
    margin-top: 8px;
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.85rem;
}

/* Submit button styling */
.profile-form .submit-btn {
    background: linear-gradient(135deg, rgba(121, 68, 254, 0.9), rgba(41, 196, 255, 0.9));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
    width: auto;
}

.profile-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(121, 68, 254, 0.4);
    background: linear-gradient(135deg, rgba(121, 68, 254, 1), rgba(41, 196, 255, 1));
}

.profile-form .submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Image Cropping Modal Styles */
.crop-modal {
    display: none;
    position: fixed;
    z-index: 2147483647;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.crop-modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    border-radius: 20px;
    width: 90vw;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(31, 31, 56, 0.8);
}

.crop-modal-header h3 {
    color: #e2e8f0;
    margin: 0;
    font-weight: 600;
}

.crop-modal-close {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.crop-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #667eea;
}

.crop-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100% - 140px);
    overflow-y: auto;
}

.crop-container {
    width: 100%;
    height: calc(100% - 200px);
    min-height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.crop-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.crop-controls {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.crop-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
}

.crop-control-group label {
    font-weight: 600;
    min-width: 80px;
}

.crop-control-group input[type="range"] {
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.crop-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.crop-control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.crop-control-group span {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.crop-advanced-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.crop-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.crop-control-btn {
    background: rgba(31, 31, 56, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.crop-control-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.crop-control-btn:active {
    transform: translateY(0);
}

.crop-control-btn i {
    font-size: 11px;
}

.crop-info {
    text-align: center;
    color: rgba(226, 232, 240, 0.7);
    font-size: 11px;
    line-height: 1.4;
}

.crop-info p {
    margin: 2px 0;
}

.crop-info strong {
    color: #667eea;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(31, 31, 56, 0.8);
}

.crop-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.crop-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.crop-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.crop-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.crop-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Cropper.js custom styles */
.cropper-container {
    border-radius: 15px;
}

.cropper-view-box {
    border-radius: 50%;
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.cropper-face {
    border-radius: 50%;
}

.cropper-line, .cropper-point {
    background-color: #667eea;
}

.cropper-bg {
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Responsive design */
@media (max-width: 768px) {
    .crop-modal-content {
        width: 95vw;
        height: 95vh;
        max-height: none;
    }
    
    .crop-container {
        height: calc(100% - 180px);
        min-height: 250px;
    }
    
    .crop-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .crop-control-group {
        justify-content: space-between;
    }
    
    .crop-control-group input[type="range"] {
        width: 120px;
    }
    
    .crop-buttons {
        gap: 8px;
    }
    
    .crop-control-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .crop-modal-content {
        width: 98vw;
        height: 98vh;
        border-radius: 15px;
    }
    
    .crop-modal-header {
        padding: 15px 20px;
    }
    
    .crop-modal-body {
        padding: 15px;
        height: calc(100% - 120px);
    }
    
    .crop-modal-footer {
        padding: 15px 20px;
    }
}
