* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f4f7fb;
    color: #333;
}

header {
    background: #0d6efd;
    color: white;
    text-align: center;
    padding: 25px;
}

header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

header p {
    font-size: 16px;
}

/* NAVIGATION BAR */
nav {
    background: #084dbd;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    transition: 0.3s;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    text-align: center;
    transition: .3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 20px;
    color: #666;
}

button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #084dbd;
}

.upload-box {
    border: 3px dashed #0d6efd;
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    background: #eef5ff;
    transition: .3s;
}

.upload-box:hover {
    background: #dcecff;
}

.upload-box h3 {
    color: #0d6efd;
    margin-bottom: 10px;
}

.upload-box p {
    color: #666;
}

/* GLOBAL PREVIEW IMAGE FIX FOR ALL TOOLS */
#preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    background: #eee;
}

#status {
    margin-top: 20px;
    font-weight: bold;
    color: #0d6efd;
    text-align: center;
}

#imageInfo {
    background: #f5f9ff;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border: 1px solid #d0e3ff;
}

#imageInfo p {
    margin: 8px 0;
    font-size: 15px;
}

/* =========================================
   DARK MODE STYLES
========================================= */
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

body.dark-mode .card {
    background: #1e1e1e;
    box-shadow: 0 5px 15px rgba(255,255,255,0.05);
}

body.dark-mode .upload-box {
    background: #2a2a2a;
    border-color: #0d6efd;
}

body.dark-mode .upload-box:hover {
    background: #333333;
}

body.dark-mode .upload-box p {
    color: #aaaaaa;
}

body.dark-mode #imageInfo, 
body.dark-mode #studioControls,
body.dark-mode #convertOptions,
body.dark-mode #resizeControls,
body.dark-mode #compressControls,
body.dark-mode #previewSection div {
    background: #2a2a2a !important;
    border-color: #444 !important;
}

/* FIXED DROPDOWN & INPUTS IN DARK MODE */
body.dark-mode select, 
body.dark-mode input[type="number"],
body.dark-mode select option {
    background: #333333 !important;
    color: #ffffff !important;
    border-color: #555 !important;
}

body.dark-mode #preview {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode h2, 
body.dark-mode h3 {
    color: #ffffff;
}

/* =========================================
   DROPDOWN MENU STYLES
   ========================================= */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    z-index: 100;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
}

/* Style the links inside the dropdown */
.dropdown-content a {
    color: #333333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    margin: 0;
    border-radius: 0;
    font-size: 15px;
    text-align: left;
    background: transparent;
}

.dropdown-content a:hover {
    background-color: #f4f7fb;
    color: #084dbd;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Dark Mode Support for Dropdowns */
body.dark-mode .dropdown-content {
    background-color: #2a2a2a;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.6);
}

body.dark-mode .dropdown-content a {
    color: #ffffff;
}

body.dark-mode .dropdown-content a:hover {
    background-color: #3d3d3d;
    color: #66b2ff;
}
