
/* ============================================================
   JIRAFEAU - Unified Theme (matching index.html)
   ============================================================ */

/* ----- Theme Variables ----- */
:root {
    --bg-start: #0a0a0f;
    --bg-mid: #12121a;
    --bg-end: #08080d;
    --text-primary: #d4edff;
    --text-secondary: #e0f0ff;
    --text-muted: #8a9bb0;
    --accent: #4da6ff;
    --accent-hover: #6bb5ff;
    --accent-dim: #2b7fc4;
    --card-bg: rgba(14, 14, 22, 0.85);
    --card-hover: rgba(20, 20, 32, 0.9);
    --border-color: rgba(43, 127, 196, 0.2);
    --shadow-color: rgba(0, 80, 180, 0.15);
    --modal-bg: rgba(8, 8, 13, 0.97);
    --modal-content: rgba(14, 14, 22, 0.98);
    --error-bg: rgba(255, 80, 80, 0.15);
    --error-border: rgba(255, 80, 80, 0.3);
    --success-bg: rgba(80, 255, 120, 0.12);
    --success-border: rgba(80, 255, 120, 0.25);
    --input-bg: rgba(14, 14, 22, 0.6);
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
    --transition: 0.3s ease;
}

/* Dark (default) */
[data-theme="dark"] {
    --bg-start: #0a0a0f;
    --bg-mid: #12121a;
    --bg-end: #08080d;
    --text-primary: #d4edff;
    --text-secondary: #e0f0ff;
    --text-muted: #8a9bb0;
    --accent: #4da6ff;
    --accent-hover: #6bb5ff;
    --accent-dim: #2b7fc4;
    --card-bg: rgba(14, 14, 22, 0.85);
    --card-hover: rgba(20, 20, 32, 0.9);
    --border-color: rgba(43, 127, 196, 0.2);
    --shadow-color: rgba(0, 80, 180, 0.15);
    --modal-bg: rgba(8, 8, 13, 0.97);
    --modal-content: rgba(14, 14, 22, 0.98);
    --error-bg: rgba(255, 80, 80, 0.15);
    --error-border: rgba(255, 80, 80, 0.3);
    --success-bg: rgba(80, 255, 120, 0.12);
    --success-border: rgba(80, 255, 120, 0.25);
    --input-bg: rgba(14, 14, 22, 0.6);
}

/* Light */
[data-theme="light"] {
    --bg-start: #e8f4ff;
    --bg-mid: #d4edff;
    --bg-end: #c0d8ff;
    --text-primary: #1a2b3d;
    --text-secondary: #2a3d5a;
    --text-muted: #3a5a7a;
    --accent: #2b7fc4;
    --accent-hover: #1a6ab0;
    --accent-dim: #4da6ff;
    --card-bg: rgba(230, 245, 255, 0.85);
    --card-hover: rgba(200, 225, 250, 0.9);
    --border-color: rgba(43, 127, 196, 0.3);
    --shadow-color: rgba(43, 127, 196, 0.15);
    --modal-bg: rgba(230, 245, 255, 0.95);
    --modal-content: rgba(240, 248, 255, 0.98);
    --error-bg: rgba(255, 80, 80, 0.1);
    --error-border: rgba(255, 80, 80, 0.25);
    --success-bg: rgba(40, 200, 80, 0.1);
    --success-border: rgba(40, 200, 80, 0.2);
    --input-bg: rgba(230, 245, 255, 0.6);
}

/* Blue */
[data-theme="blue"] {
    --bg-start: #0a1a3a;
    --bg-mid: #1a3a6a;
    --bg-end: #0a1a3a;
    --text-primary: #c0d8ff;
    --text-secondary: #d4e8ff;
    --text-muted: #8ab0e8;
    --accent: #6a9fff;
    --accent-hover: #8ab8ff;
    --accent-dim: #3a7ac4;
    --card-bg: rgba(16, 34, 74, 0.85);
    --card-hover: rgba(26, 54, 94, 0.9);
    --border-color: rgba(74, 154, 255, 0.4);
    --shadow-color: rgba(74, 154, 255, 0.25);
    --modal-bg: rgba(10, 26, 58, 0.95);
    --modal-content: rgba(16, 34, 74, 0.98);
    --error-bg: rgba(255, 80, 80, 0.12);
    --error-border: rgba(255, 80, 80, 0.25);
    --success-bg: rgba(80, 255, 120, 0.1);
    --success-border: rgba(80, 255, 120, 0.2);
    --input-bg: rgba(16, 34, 74, 0.6);
}

/* Purple */
[data-theme="purple"] {
    --bg-start: #1a0a2b;
    --bg-mid: #2a1a4a;
    --bg-end: #1a0a2b;
    --text-primary: #e0c8ff;
    --text-secondary: #ecd4ff;
    --text-muted: #b890e8;
    --accent: #9b59b6;
    --accent-hover: #bb7ad4;
    --accent-dim: #7a3a94;
    --card-bg: rgba(34, 16, 54, 0.85);
    --card-hover: rgba(44, 26, 74, 0.9);
    --border-color: rgba(155, 89, 182, 0.4);
    --shadow-color: rgba(155, 89, 182, 0.25);
    --modal-bg: rgba(26, 10, 43, 0.95);
    --modal-content: rgba(34, 16, 54, 0.98);
    --error-bg: rgba(255, 80, 80, 0.12);
    --error-border: rgba(255, 80, 80, 0.25);
    --success-bg: rgba(80, 255, 120, 0.1);
    --success-border: rgba(80, 255, 120, 0.2);
    --input-bg: rgba(34, 16, 54, 0.6);
}

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 100%;
    background: linear-gradient(145deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem;
    transition: background 0.4s ease, color 0.3s ease;
}

/* ----- Links ----- */
a, a:link, a:visited {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ----- Content Container ----- */
#content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
    position: relative;
    z-index: 1;
}

/* ----- Headings ----- */
h1 {
    font-size: 2.0rem;
    font-weight: 500;
    margin: 1% 0 2rem;
    text-align: center;
    color: var(--text-secondary);
    text-shadow: 0 0 8px rgba(56, 156, 255, 0.2);
    width: 100%;
    height: auto;
    padding-top: 0;
}

h1 a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

h1 a:hover {
    color: var(--accent-hover);
}

h2 {
    text-decoration: none;
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.3px;
}

h3 {
    color: var(--text-secondary);
}

/* ----- Fieldsets (Forms) ----- */
fieldset {
    text-align: left;
    font-size: 90%;
    max-width: 50em;
    width: 100%;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

fieldset:hover {
    border-color: var(--accent-dim);
}

fieldset legend {
    color: var(--text-secondary);
    font-size: 130%;
    background: var(--accent-dim);
    border: none;
    padding: 5px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    letter-spacing: -0.2px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

fieldset p {
    margin-left: 0;
    padding: 0.25rem 0;
}

fieldset table {
    width: 100%;
}

fieldset table td {
    padding: 0.3rem 0;
}

fieldset .label {
    width: 30%;
    min-width: 120px;
}

/* ----- Form Elements ----- */
label {
    float: none;
    display: inline-block;
    width: auto;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="file"],
select {
    width: 100%;
    max-width: 20em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    padding: 0.6rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

input[type="submit"],
input[type="button"],
button {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    padding: 0.6rem 1.8rem;
    background: var(--accent-dim);
    color: #fff;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 4px 12px var(--shadow-color);
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

input[type="submit"]:active,
input[type="button"]:active,
button:active {
    transform: scale(0.97);
}

/* ----- Upload Form ----- */
#upload {
    text-align: left;
    font-size: 90%;
    max-width: 50em;
    width: 100%;
    background: transparent;
    border: none;
    margin: 1.5rem auto;
    border-radius: 0;
}

#upload form fieldset {
    padding: 2rem;
}

#upload .config {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0;
    text-align: center;
}

#upload #options {
    margin-top: 0.5rem;
}

#upload #option_table {
    width: 100%;
}

#upload #option_table td {
    padding: 0.4rem 0;
}

#upload #option_table tr td:first-child {
    width: 40%;
    color: var(--text-secondary);
    font-weight: 500;
}

#upload input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ----- Uploading Status ----- */
#uploading {
    text-align: center;
    max-width: 50em;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin: 1.5rem auto;
    padding: 2rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#uploading p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

#uploaded_percentage {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0.5rem 0;
}

#uploaded_speed,
#uploaded_time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ----- Upload Finished ----- */
#upload_finished {
    font-size: 90%;
    text-align: center;
    padding: 2rem;
    max-width: 50em;
    width: 100%;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius);
    margin: 1.5rem auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#upload_finished a {
    font-weight: 600;
}

#self_destruct {
    font-weight: bold;
    color: #ff6b6b;
}

/* ----- Error & Message ----- */
.error, .message {
    max-width: 50em;
    width: 100%;
    margin: 1.5rem auto;
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-align: center;
}

.error {
    border: 1px solid var(--error-border);
    background-color: var(--error-bg);
}

.error p:before {
    content: '⚠️ ';
    padding-right: 0.5rem;
}

.message {
    border: 1px solid var(--success-border);
    background-color: var(--success-bg);
}

.message p:before {
    content: '✅ ';
    padding-right: 0.5rem;
}

/* ----- Info ----- */
.info {
    text-align: left;
    max-width: 50em;
    width: 100%;
    margin: 1.5rem auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.info h2 {
    text-align: left;
}

.info h3 {
    text-align: center;
}

.info p {
    margin-left: 0;
    margin-right: 0;
}

/* ----- Login / Logout Forms ----- */
.form.login,
.form.logout {
    max-width: 50em;
    width: 100%;
    margin: 1rem auto;
}

.form.login fieldset,
.form.download fieldset {
    padding: 2rem;
}

.form.login table {
    width: 100%;
}

.form.login table td {
    padding: 0.4rem 0;
}

.form.login .label {
    width: 30%;
    min-width: 100px;
}

.form.login .nav {
    padding-top: 0.8rem;
}

.form.logout {
    text-align: center;
}

.form.logout input[type="submit"] {
    background: rgba(255, 80, 80, 0.3);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.4rem 1.5rem;
}

.form.logout input[type="submit"]:hover {
    background: rgba(255, 80, 80, 0.5);
    color: #ff6b6b;
}

/* ----- Download Form ----- */
.form.download fieldset legend {
    font-size: 1.1rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form.download .tos {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ----- Copy Buttons ----- */
#upload_link_email {
    margin-left: 10px;
}

#upload_image_email {
    padding-bottom: 15px;
    padding-left: 20px;
    background: url(email.png) no-repeat;
}

/* ----- Jyraphe Logo ----- */
#jyraphe {
    background: url('jyraphe.png') right bottom no-repeat;
    position: fixed;
    bottom: 0;
    right: 0;
    height: 50px;
    width: 50px;
    clear: both;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   FOOTER - Matching index.html with increased spacing
   ============================================================ */
#copyright {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 1.2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
    max-width: 1200px;
    width: 100%;
}

#copyright p {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    width: 100%;
    margin: 0;
    padding: 0.3rem 0;
}

#copyright p .footer-sep {
    color: var(--text-muted);
    margin: 0 0.3rem;
    opacity: 0.5;
}

#copyright a {
    color: var(--accent);
    transition: color 0.2s ease;
    text-decoration: none;
}

#copyright a:hover {
    color: var(--accent-hover);
}

/* Theme link - same style as TOS */
#copyright .theme-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

#copyright .theme-link:hover {
    color: var(--accent-hover);
}

/* ============================================================
   THEME SETTINGS MODAL (matching index.html)
   ============================================================ */
.theme-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    will-change: opacity;
}

.theme-modal.active {
    display: flex;
}

.theme-modal-content {
    position: relative;
    background: var(--modal-content);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    margin: 1rem;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
    animation: modalAppear 0.3s ease;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-modal.closing .theme-modal-content {
    animation: modalDisappear 0.25s ease forwards;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateZ(0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes modalDisappear {
    from {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateZ(0);
    }
}

.theme-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(43, 127, 196, 0.15);
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.theme-modal-close:hover {
    background: rgba(43, 127, 196, 0.3);
}

.settings-title {
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.settings-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.theme-option {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.theme-option:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.theme-option:active {
    transform: scale(0.97);
}

.theme-option.active {
    border-color: var(--accent);
    background: var(--card-hover);
    box-shadow: 0 0 20px var(--shadow-color);
}

.theme-option .theme-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.3rem;
}

.theme-option .theme-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.theme-option .theme-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.settings-current {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 0.75rem;
    }
    
    #content {
        padding: 0 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin: 0.5rem 0 1.5rem;
    }
    
    fieldset {
        padding: 1.2rem;
        border-radius: var(--radius-sm);
    }
    
    fieldset legend {
        font-size: 1.1rem;
        padding: 4px 14px;
    }
    
    #upload form fieldset {
        padding: 1.2rem;
    }
    
    #upload #option_table tr td:first-child {
        width: 35%;
        font-size: 0.9rem;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="file"],
    select {
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
    
    input[type="submit"],
    input[type="button"],
    button {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }
    
    #uploading {
        padding: 1.2rem;
    }
    
    #uploaded_percentage {
        font-size: 1.5rem;
    }
    
    .error, .message, .info {
        padding: 1rem 1.2rem;
    }
    
    #copyright {
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
        margin-top: 1rem;
    }
    
    #copyright p {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    #copyright p .footer-sep {
        display: none;
    }
    
    #jyraphe {
        height: 35px;
        width: 35px;
        background-size: contain;
    }
    
    .theme-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .theme-options {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .theme-option {
        padding: 0.8rem;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .theme-option .theme-icon {
        font-size: 1.5rem;
    }
    
    .settings-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    fieldset table td {
        display: block;
        width: 100%;
    }
    
    fieldset table td:first-child {
        margin-bottom: 0.2rem;
    }
    
    .form.login .label {
        width: 100%;
        min-width: unset;
    }
    
    #upload #option_table tr td:first-child {
        width: 100%;
    }
    
    #upload #option_table tr td {
        display: block;
        width: 100%;
    }
}

/* ----- Utility ----- */
.jyraphe_info {
    font-size: 120%;
    margin-left: 0;
    text-align: center;
}