/* ====================================================================
  Resume Fixer Pro - New Tool CSS V2 (Final Mobile Fix)
==================================================================== */

/* FOUC Fix */
body.no-fouc {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}
body.fouc-ready {
    opacity: 1;
    visibility: visible;
}

/* ======================================================= */
/* === START: FINAL DYNAMIC COLOR SCORE GAUGE UI === */
/* ======================================================= */

/* Main container for the gauge */
.score-gauge {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6; /* Light gray background */
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* This creates the colored ring that fills up */
.score-gauge::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    
    /* Yeh ab poore circle ko '--active-color' se bhar dega jo JS se aa raha hai */
    background: var(--active-color, #e5e7eb);

    /* This creates the donut hole in the middle */
    -webkit-mask-image: radial-gradient(transparent 65%, black 66%);
    mask-image: radial-gradient(transparent 65%, black 66%);
}

/* The white circle in the center containing the text */
.score-gauge .score-text-container {
    background: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
}

/* The score number (e.g., 80) */
#score-text {
    font-size: 2.75rem; /* 44px */
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

/* This adds "out of 100" text below the score */
#score-text::after {
    content: "out of 100";
    font-size: 0.8rem; /* 12.8px */
    font-weight: 500;
    color: #6b7280; /* gray-500 */
    display: block;
    margin-top: 2px;
}

/* Isme koi badlav nahi hai, yeh pehle se theek hai */
#score-description.text-green-600 {
    color: #15803d !important; /* Darker Green */
}
#score-description.text-yellow-500 {
    color: #b45309 !important; /* Darker Yellow/Amber */
}
#score-description.text-red-500 {
    color: #991b1b !important; /* Darker Red */
}

/* ======================================================= */
/* === END: FINAL DYNAMIC COLOR SCORE GAUGE UI === */
/* ======================================================= */

/* Sidebar Styling */
#resume-preview-template .left-panel,
#resume-preview-template .left-panel h3 {
    color: #f3f4f6;
}
#resume-preview-template .left-panel .content-container,
#resume-preview-template .left-panel li,
#resume-preview-template .left-panel p {
    color: #d1d5db;
}
#resume-preview-template .left-panel strong,
#resume-preview-template .left-panel h4 {
    color: #ffffff;
}
#resume-preview-template .bg-gray-800 h3 {
    color: #ffffff !important;
    border-bottom-color: #6b7280 !important;
}
h3[contenteditable="true"]:focus {
    outline: 2px solid #3b82f6;
    background-color: #eff6ff;
    color: #1f2937 !important;
    border-radius: 4px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.remove-section-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
.remove-section-btn:hover {
    opacity: 1;
}

/* Photo Upload */
#preview-photo-area {
    position: relative;
    width: 100px;
    height: 100px;
    z-index: 1;
}
#remove-photo {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
}
#remove-photo:hover {
    background-color: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}
.photo-uploaded img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Editable Content Focus */
.content-container[contenteditable="true"]:focus {
    outline: 2px solid #3b82f6;
    background-color: #f8fafc;
    border-radius: 4px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    padding: 8px;
    margin: -8px;
    color: #2d3748;
}

/* Add Section Form */
.temp-add-section-form {
    padding: 1rem;
    margin-top: 1rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.temp-add-section-form input,
.temp-add-section-form button {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.temp-add-section-form .form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Misc Fixes */
#upload-area svg {
    width: 48px;
    height: 48px;
}
#preview-note,
#job-chance {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
}
#how-to-link {
    text-decoration: underline;
    font-size: 0.875rem;
    color: #3b82f6;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Global Fix */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    background: #ffffff;
}

/* ======================================================= */
/* === FINAL, WORKING CSS FOR MOBILE PREVIEW === */
/* ======================================================= */

@media (max-width: 1023px) {
    /* Wrapper's height will now be controlled by JavaScript */
    #resume-preview-wrapper {
        position: relative !important;
        width: 100% !important;
        z-index: 1;
        /* NOTE: height and padding-bottom are removed from here */
    }

    /* This CSS scales and centers the preview */
    #resume-preview-template {
        width: 850px !important;
        height: auto !important;
        min-height: 1100px !important;
        position: absolute !important;
        top: 0 !important;
        left: 50% !important;
        transform-origin: top center !important;
        
        /* Default scale for smallest phones */
        transform: translateX(-50%) scale(0.40) !important;
    }

    /* Scale for larger phones */
    @media (min-width: 450px) and (max-width: 767px) {
        #resume-preview-template {
            transform: translateX(-50%) scale(0.48) !important;
        }
    }

    /* Scale for tablets */
    @media (min-width: 768px) and (max-width: 1023px) {
        #resume-preview-template {
            transform: translateX(-50%) scale(0.75) !important;
        }
    }
}
