:root {
    --bg-color: #1a1a1a;
    --card-bg: rgba(30, 30, 30, 0.9);
    --green-gradient: linear-gradient(135deg, #28a745 0%, #218838 100%);
    --text-main: #f3f4f6;
    --text-muted: #d1d5db;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    text-align: center;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 123, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(255, 0, 255, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    padding: 0;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    width: 100%;
}

/* Topmenu & Hamburger */
.top-header {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: #f1c40f;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: 0.3s;
}

/* Venstre Sidemenu */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #1e1e1e;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 40px 20px;
    box-sizing: border-box;
    text-align: left;
}

.sidebar.open {
    left: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin-top: 40px;
}

.sidebar ul li {
    margin-bottom: 20px;
}

.sidebar ul li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.2s;
}

.sidebar ul li a:hover {
    color: #f1c40f;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

.main-content {
    padding: 80px 20px 40px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1.floating-h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 30px;
    letter-spacing: -0.025em;
    text-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    line-height: 1.25;
    max-width: 900px;
}

h1.floating-h1 .highlight-yellow {
    color: #f1c40f;
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    justify-content: center;
    align-items: flex-start;
}

.card { 
    background: var(--card-bg); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 35px 30px; 
    border-radius: 26px; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8); 
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.card-left {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-right {
    flex: 1;
    min-width: 320px;
    max-width: 520px;
}

.input-group { 
    margin-bottom: 20px; 
    text-align: left;
    width: 100%;
}

label { 
    display: block; 
    font-size: 15px; 
    font-weight: 600;
    color: #f1c40f; 
    margin-bottom: 8px; 
}

input[type="text"] { 
    padding: 14px 18px; 
    font-size: 16px; 
    background: rgba(25, 25, 25, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2); 
    border-radius: 12px; 
    width: 100%; 
    color: #ffffff;
    box-sizing: border-box; 
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3);
}

.template-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.template-thumb {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.template-thumb:hover {
    transform: scale(1.05);
}

.template-thumb.active {
    border-color: #f1c40f;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: rgba(25, 25, 25, 0.6);
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: #f1c40f;
    background: rgba(25, 25, 25, 0.9);
}

.drop-zone p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.drop-zone input[type="file"] {
    display: none;
}

.meme-preview-box {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.meme-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.meme-text {
    position: absolute;
    width: 85%;
    left: 50%;
    transform: translateX(-50%);
    font-family: Impact, sans-serif;
    font-size: 28px;
    color: white;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 
        -2px -2px 0 #000,  
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000,
         0px 4px 6px rgba(0,0,0,0.8);
    word-wrap: break-word;
    pointer-events: none;
    z-index: 10;
}

.meme-text-top {
    top: 15px;
}

.meme-text-bottom {
    bottom: 15px;
}

/* Moderne og strømlinet toggle inspireret af billedet */
.visibility-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(25, 25, 25, 0.8);
    padding: 14px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.visibility-box:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.toggle-label-container {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.toggle-title {
    font-size: 15px;
    font-weight: 600;
    color: #f1c40f;
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3e3e42;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background-color: #2ecc71;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 10px rgba(46, 204, 113, 0.4);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

button.calc-btn { 
    background: var(--green-gradient); 
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.25); 
    padding: 16px 25px; 
    font-size: 18px; 
    font-weight: 700;
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    margin-top: 10px;
    text-align: center;
}

button.calc-btn:hover { 
    transform: translateY(-2px);
    opacity: 0.9;
}

.agency-footer {
    padding: 20px;
    font-size: 16px; 
    opacity: 0.7;
    text-align: center;
    width: 100%;
}

.agency-footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
        align-items: center;
    }
}