@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Oswald:wght@700&display=swap');

/* Global Styles */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: #121212;
    color: #ffffff;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    gap: 40px;
}

/* Container for the main layout */
.container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap; 
    justify-content: center;
}

/* --- INPUT FORM PANEL --- */
.input-panel {
    background-color: #242424;
    padding: 30px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.input-panel h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8em;
    color: #e5e5e5;
    margin-bottom: 25px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #b0b0b0;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    box-sizing: border-box;
    font-size: 1em;
}

.form-group input:focus {
    border-color: #ff0000;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* Custom File Input Styling */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 25px;
}

#file-upload-label {
    background-color: #ff0000;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-top: 10px;
}

#file-upload-label:hover {
    background-color: #cc0000;
}

#file-upload {
    display: none;
}

.upload-icon {
    font-size: 2.5em;
    color: #ff0000;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

/* --- GRAPHIC PREVIEW PANEL --- */
.graphic-preview {
    width: 500px;
    height: 500px;
    
    /* --- FORCING NEW BACKGROUND IMAGE --- */
    background-image: url('base-image.png') !important; /* !!! ADDED !important !!! */
    background-color: #1a1a1a; 
    background-size: cover;
    background-position: center;
    /* ----------------------------------- */
    
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Background image/texture (using the actual image) */
.graphic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ensure you have background.jpg in your folder */
    background-image: url('base-image.png'); 
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a; 
    z-index: 1;
}

/* Image Display (The uploaded candidate photo) */
#graphic-picture {
    position: absolute;

    /* Target size of the frame — remove fixed height */
    width: 280px;
    height: auto;

    /* Keeps image from stretching */
    aspect-ratio: 2 / 3; /* or 1 / 1.45 depending on your design */

    object-fit: cover;  /* crop instead of stretch */
    object-position: center;

    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
/* Text Overlay Area */
.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    box-sizing: border-box;
    z-index: 3;
    /* Gradient for text contrast */
    background: linear-gradient(to right, rgba(26, 26, 26, 0.0) 50%, rgba(26, 26, 26, 0.9) 100%);
}

/* Logo/Header */
.logo {
    position: absolute;
    top: 30px;
    right: 30px;
    text-align: right;
    width: 150px;
}
/* Styling for the actual logo image */
#graphic-logo {
    width: 150px; 
    height: auto;
    display: block;
}


/* Text Content Area (Precision Positioning) */
.text-content {
    text-align: right;
    position: absolute;
    right: 30px;
    width: 45%; 
    /* Positioning content start point */
    top: 190px; 
}

/* Name and Position */
#graphic-name {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5em; 
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin: 0;
    padding-bottom: 5px;
    /* Added text shadow for the white glow effect */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); 
}
#graphic-position {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1em; 
    font-weight: 400;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
    padding-bottom: 20px; 
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3); 
}

/* Amount and Source */
#graphic-amount {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    /* Used the specific red color from the logo */
    color: #F80000; 
    margin: 0; 
    line-height: 1;
    padding-bottom: 5px;
    /* Added text shadow for the glow effect */
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 5px rgba(255, 0, 0, 0.5);
}
#graphic-source {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2em;
    font-weight: 400;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
    padding-top: 5px; /* Added spacing after amount */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* --- NEW FOOTER STYLES --- */

/* 1. Date and Source Text (Small white text above the box) */
.date-source-text {
    position: absolute;
    bottom: 55px; /* Positioned just above the red box */
    right: 65px;
    font-size: 0.8em;
    color: #ffffff;
    z-index: 4;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7); /* Subtle shadow for readability */
}

/* 2. Red Twitter Handle Box */
.twitter-box {
    position: absolute;
    bottom: 0;
    right: 30px;
    width: 190px; /* Fixed width to match the original image scale */
    height: 40px; /* Fixed height */
    background-color: #952319;
    display: flex;
    justify-content: center; /* Center the text inside the box */
    align-items: center;
    z-index: 4;
}

/* 3. Twitter Handle Text */
.twitter-handle {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4em; /* Slightly adjusted size */
    font-weight: 700;
    color: #ffffff;
}

#graphic-date {
    font-weight: bold;
}



/* Download Button */
.download-button-container {
    text-align: center;
    margin-top: 20px;
    width: 100%;
}

.btn-download {
    background-color: #ff0000;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: not-allowed;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-download:not([disabled]) {
    cursor: pointer;
}
.btn-download:not([disabled]):hover {
    background-color: #cc0000;
}

/* Temporary for image placeholder */
.image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1.2em;
    text-align: center;
    z-index: 3;
}