@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.6);
    --bg-surface-hover: rgba(51, 65, 85, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-color: #3b82f6;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --glow: 0 0 20px rgba(59, 130, 246, 0.5);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.15), transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

hr {
    border: none;
    border-bottom: 1px solid var(--border-color);
    margin: 20px 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

/* Container */
#container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Logo */
#logo {
    text-align: center;
    margin: 40px auto;
    transition: transform 0.3s ease;
}

#logo:hover {
    transform: scale(1.02);
}

#logo img {
    border: 0;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

/* Menu */
#menu {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#menu_links {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 20px;
}

#menu_links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}

#menu_links li {
    margin: 0;
}

#menu_links a {
    background: transparent;
    padding: 10px 20px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

#menu_links a:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--border-color);
}

/* Boxes & Cards (Glassmorphism) */
#index_upload, #content, .ticket_reply, #uploadcodes, #allimagecodes, .supportform {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 30px;
    margin: 20px auto;
    color: var(--text-primary);
}

#index_upload {
    max-width: 600px;
    text-align: center;
}

/* Form Elements */
input[type="text"], input[type="password"], textarea, select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}

input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-align: left;
}

/* Buttons */
.button, input[type="submit"], button, .upload_now input {
    background: var(--accent-gradient) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md) !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
    display: inline-block;
    text-align: center;
}

.button:hover, input[type="submit"]:hover, button:hover, .upload_now input:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5) !important;
    filter: brightness(1.1);
}

.button:active, input[type="submit"]:active, button:active {
    transform: translateY(1px);
}

/* Overriding jQuery UI for Tabs */
.ui-widget-content {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
}

.ui-widget-header {
    background: rgba(0,0,0,0.2) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
    background: transparent !important;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    padding: 12px 20px !important;
}

.ui-state-hover a, .ui-state-focus a {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.05) !important;
}

.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
    background: rgba(59, 130, 246, 0.2) !important;
    border-bottom: 2px solid var(--accent-color) !important;
}

.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
    color: var(--accent-color) !important;
}

.ui-tabs .ui-tabs-panel {
    padding: 30px 20px !important;
}

/* Upload / Image displaying */
.all_images div.img_and_text {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    transition: all 0.3s ease;
    width: 200px;
    height: 260px;
    margin: 10px;
    box-sizing: border-box;
}

.all_images div.img_and_text:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: var(--glow);
}

.all_images img {
    border-radius: var(--radius-sm);
    border: none !important;
    max-width: 100%;
    height: 160px;
    object-fit: cover;
    margin-bottom: 10px;
}

/* Alerts */
p.error, p.error2 {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: #fca5a5;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
}

p.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success-color);
    color: #86efac;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
}

div.head_info, p.info {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid var(--accent-color) !important;
    color: #93c5fd;
    border-radius: var(--radius-sm);
    padding: 12px 20px 12px 40px !important;
    font-weight: 500;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    overflow: hidden;
}

th, td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

th {
    background: rgba(0,0,0,0.4);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Pagination */
#pagination {
    text-align: center;
    margin: 40px 0;
}

#pagination a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin: 0 4px;
}

#pagination a:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

/* Footer */
#footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

#footer a {
    color: var(--text-primary);
}

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

/* Small Fixes */
.invisible { display: none; }
.clear { clear: both; }

/* Image uploaded page */
#uploadedimage img.centred, img.centred_resized {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color) !important;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

#uploadedimage img.centred:hover {
    transform: scale(1.01);
    border-color: var(--accent-color) !important;
    box-shadow: var(--glow);
}

/* Admin specific overrides */
.zitem {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Forms layout */
fieldset.logreg {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(0,0,0,0.2);
    padding: 30px;
}

legend.logreg {
    background: var(--accent-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: var(--shadow-soft);
}

/* Misc old classes */
.style1, .style2 { background: transparent !important; }
.redcolor { background: rgba(239, 68, 68, 0.1) !important; }
.greencolor { background: rgba(34, 197, 94, 0.1) !important; }
.yellowcolor { background: rgba(234, 179, 8, 0.1) !important; }
