/* styles.css */
* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'JMH Typewriter';
    src: url('font/shine_typewriter/ShineTypewriter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #373737;
    --secondary-color: #4e4e4e;
    --background-color: #efefef;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --text-color: #111;
    --button-bg: #2d2d2d;
    --button-hover: #4d4d4d;
    font-family: 'JMH Typewriter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'JMH Typewriter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.navbar a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.navbar a.btn {
    background-color: var(--text-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    margin-left: 20px;
    transition: background-color 0.3s ease;
}

.navbar a.btn:hover {
    background-color: #333;
}

.main-section {
    max-width: 890px;
    margin: 60px auto;
    text-align: center;
    padding: 0 20px;
}

.main-section h1 {
    font-size: 2.9rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.main-section p {
    font-size: 1.2rem;
    color: #474747;
    margin-bottom: 40px;
}

.email-box {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 30px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.email-box h4 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.email-box p {
    font-size: 0.99rem;
    color: #3b3b3b;
    margin-bottom: 20px;
}

.email-box textarea {
    width: 100%;
    height: 270px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    resize: vertical;
    background: #fff;
    color: #464646;
    font-family: 'JMH Typewriter', 'Courier New', monospace;
}

.email-box button {
    margin-top: 20px;
    background-color: var(--button-bg);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'JMH Typewriter', 'Courier New', monospace;
}

.email-box button:hover {
    background-color: var(--button-hover);
}

.analysis-block {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    background-color: #f4f4f4;
    border-left: 4px solid var(--secondary-color);
}

.analysis-block p {
    margin: 10px 0 0;
    color: #282828;
    font-size: 0.99rem;
}

.analysis-block h4 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
}

.score {
    font-weight: bold;
    color: #dc3545;
}

.score.green {
    color: #28a745;
}

.green {
    color: #28a745;
    font-weight: bold;
}

.risk-bar-container {
    width: 100%;
    background: #ddd;
    border-radius: 8px;
    height: 14px;
    overflow: hidden;
    margin-top: 12px;
}

.risk-bar {
    height: 100%;
    transition: width 0.4s ease, background 0.4s ease;
}

.risk-label {
    text-align: right;
    font-size: 0.9rem;
    margin-top: 4px;
    color: #444;
    font-weight: 500;
}

#riskbardiv {
    margin-top: 60px !important;
}

.recommend-email-box{
      max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    background-color: #f4f4f4;
    border-left: 4px solid #4e4e4e;
}
.recommend-email-box h4{
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
}

#email_div h5{
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #282828;
    font-size: 1rem;

}
#email_div{
    margin-top: 12px;
}

#copyBtn {
    margin-top: 20px;
    background-color: var(--button-bg);
    color: #fff;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'JMH Typewriter', 'Courier New', monospace;
}

#copyBtn:hover {
    background-color: var(--button-hover);
}

#recommendedEmailText {
    width: 100%;
    height: auto;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    color: #282828;
    font-family: 'JMH Typewriter', 'Courier New', monospace;
}

/* --- RESPONSIVE FIXES --- */

/* Tablets */
@media (max-width: 992px) {
    .main-section h1 {
        font-size: 2.3rem;
    }

    .main-section p {
        font-size: 1.05rem;
    }

    .email-box {
        padding: 20px;
    }
}

/* Mobiles */
@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: center; /* ✅ center logo */
        padding: 15px 20px;
    }

    .navbar img {
        height: 32px;
    }

    .main-section {
        margin-top: 40px;
        padding: 0 15px;
    }

    .main-section h1 {
        font-size: 1.9rem;
    }

    .main-section p {
        font-size: 1rem;
    }

    .email-box {
        padding: 20px;
    }

    .email-box textarea {
        height: 200px;
        font-size: 0.95rem;
    }

    .email-box button {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    .analysis-block {
        padding: 15px;
        font-size: 0.95rem;
    }
}

.flash {
    animation: flash-bg 1.2s ease forwards;
}

@keyframes flash-bg {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 210, 105, 0.0);
    }
    10% {
        box-shadow: 0 0 0 8px rgba(255, 210, 105, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 210, 105, 0.0);
    }
}
