/* static/css/style.css */

/* فونت Borna */
@import url("/static/fonts/borna/fontface.css");

/* متغیرهای رنگ */
:root {
    --primary-dark: #0a0a1a;
    --secondary-dark: #121230;
    --accent-blue: #00d4ff;
    --accent-purple: #9d4edd;
    --accent-pink: #ff00cc;
    --diamond-color: #b9f2ff;
    --text-light: #ffffff;
    --text-glow: rgba(185, 242, 255, 0.8);
    --shadow-glow: 0 0 15px rgba(0, 212, 255, 0.5);
    --shadow-glow-strong: 0 0 25px rgba(0, 212, 255, 0.8);
    --border-glow: 1px solid rgba(0, 212, 255, 0.3);
    --success-color: #00ff9d;
    --error-color: #ff2a6d;
}

/* ریست و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Borna', sans-serif;
}

body {
    background-color: var(--primary-dark);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(157, 78, 221, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 40% 80%, rgba(255, 0, 204, 0.08) 0%, transparent 20%);
    min-height: 100vh;
    color: var(--text-light);
    direction: rtl;
    overflow-x: hidden;
    position: relative;
}

/* انیمیشن پس‌زمینه الماس‌ها */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300d4ff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    opacity: 0.4;
    animation: diamondFloat 30s linear infinite;
}

/* انیمیشن‌ها */
@keyframes diamondFloat {
    0% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-20px) translateX(10px) rotateY(0.5turn) scale(1.2); }
    50% { transform: translateY(-10px) translateX(-10px); }
    75% { transform: translateY(20px) translateX(5px) rotateY(-0.5turn) scale(0.8); }
    100% { transform: translateY(0px) translateX(0px); }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px var(--accent-blue); }
    50% { box-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--accent-purple); }
    100% { box-shadow: 0 0 5px var(--accent-blue); }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px var(--text-glow), 0 0 20px var(--accent-blue); }
    50% { text-shadow: 0 0 15px var(--text-glow), 0 0 25px var(--accent-blue), 0 0 30px var(--accent-purple); }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes buttonHover {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}

/* کانتینر اصلی */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

/* هدرها */
h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textGlow 3s infinite alternate, gradientMove 5s infinite;
    background-size: 200% auto;
    padding-bottom: 15px;
    border-bottom: var(--border-glow);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* آیکون الماس */
.gem-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
    background: linear-gradient(45deg, var(--accent-blue) 0%, var(--diamond-color) 50%, var(--accent-purple) 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    position: relative;
    animation: glowPulse 3s infinite, diamondFloat 8s infinite alternate;
    box-shadow: 0 0 30px rgba(185, 242, 255, 0.7);
}

.gem-icon::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.8);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    filter: blur(2px);
}

.gem-icon img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 100%;
    height: auto;
}

/* فرم‌ها */
form {
    background-color: rgba(18, 18, 48, 0.8);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border: var(--border-glow);
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

form:hover {
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(-5px);
}

label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--accent-blue);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 10px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    background-color: rgba(10, 10, 26, 0.8);
    color: var(--text-light);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.7);
    background-color: rgba(10, 10, 26, 0.9);
}

/* دکمه‌ها */
button {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
    z-index: -1;
}

button:hover {
    animation: buttonHover 0.5s ease, glowPulse 1.5s infinite;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.4);
}

button:hover::before {
    left: 100%;
}

/* بخش نتایج */
.result {
    min-height: 100px;
    background-color: rgba(18, 18, 48, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    border: var(--border-glow);
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(10px);
    transition: all 0.5s ease;
}

.result > div {
    text-align: center;
    font-size: 1.3rem;
    padding: 20px;
    border-radius: 10px;
}

/* حالت‌های مختلف نتیجه */
.not-found {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.2), rgba(157, 78, 221, 0.2));
    color: #ff7aa8;
    border: 1px solid rgba(255, 42, 109, 0.4);
    animation: glowPulse 2s infinite;
}

.found {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* جدول نتایج */
.found table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.found tr {
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    transition: background-color 0.3s ease;
}

.found tr:hover {
    background-color: rgba(0, 212, 255, 0.1);
}

.found td {
    padding: 15px 10px;
    text-align: right;
}

.found td:first-child {
    color: var(--accent-blue);
    font-weight: bold;
    width: 40%;
    border-left: 2px solid rgba(0, 212, 255, 0.3);
}

.found td:last-child {
    color: var(--text-light);
}

/* هشدارها */
.alert {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.1rem;
    border: 2px solid;
    animation: glowPulse 3s infinite;
}

.alert.error {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.2), rgba(157, 78, 221, 0.1));
    border-color: rgba(255, 42, 109, 0.5);
    color: #ff7aa8;
}

.alert.success {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 212, 255, 0.1));
    border-color: rgba(0, 255, 157, 0.5);
    color: #7affd4;
}

/* بخش آمار */
#uploadForm + div {
    background-color: rgba(10, 10, 26, 0.7) !important;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: var(--border-glow);
}

#uploadForm + div p {
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

#uploadForm + div ul {
    list-style-type: none;
}

#uploadForm + div li {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 212, 255, 0.2);
    color: var(--text-light);
}

#uploadForm + div li strong {
    color: var(--accent-purple);
}

/* لینک‌ها */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.3s ease;
}

a:hover {
    color: var(--diamond-color);
    text-shadow: 0 0 10px rgba(185, 242, 255, 0.8);
}

a:hover::after {
    width: 100%;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    margin: 40px 0;
}

/* صفحه مدیریت */
#uploadForm {
    position: relative;
}

#uploadForm::before {
    content: '💎';
    position: absolute;
    top: 0px;
    right: 50%;
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.8));
    animation: diamondFloat 5s infinite alternate;
}

/* responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    form {
        padding: 20px;
    }
    
    .gem-icon {
        width: 90px;
        height: 90px;
        margin-bottom: 30px;
    }
    
    .found td {
        padding: 10px 5px;
        font-size: 0.95rem;
    }
}