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

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; }
body { background-color: #050505; color: #fff; min-height: 100vh; overflow-x: hidden; }

header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; background: #0a0a0a; border-bottom: 2px solid #1a0000;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.15); position: sticky; top: 0; z-index: 100;
}

/* جعل اللوجو يبدو كزر */
.logo { font-size: 24px; font-weight: 700; text-shadow: 0 0 10px #ff0000; cursor: pointer; transition: 0.3s; }
.logo:hover { transform: scale(1.05); }
.logo span { color: #ff0000; text-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000; }

.search-box { display: flex; align-items: center; width: 50%; position: relative; }
.search-box input[type="text"] {
    width: 100%; padding: 12px 20px; background: #0d0d0d; border: 1px solid #330000;
    border-radius: 25px; color: #fff; font-size: 15px; outline: none; transition: 0.3s;
    padding-left: 80px; 
    padding-right: 45px; 
}
.search-box input[type="text"]:focus { border-color: #ff0000; box-shadow: 0 0 15px #ff0000; }

.search-box button {
    position: absolute; left: 5px; padding: 8px 22px; background: #ff0000; border: none;
    border-radius: 20px; color: #050505; font-weight: 700; cursor: pointer; transition: 0.3s;
}
.search-box button:hover { background: #fff; color: #ff0000; box-shadow: 0 0 20px #fff; }

.lens-icon {
    position: absolute; right: 15px; color: #aa0000; cursor: pointer;
    transition: 0.3s; z-index: 10; display: flex; align-items: center; justify-content: center;
}
.lens-icon:hover { color: #ff0000; transform: scale(1.1); filter: drop-shadow(0 0 8px #ff0000); }

main { padding: 30px; }
.error-text { text-align: center; font-size: 18px; color: #ff0000; margin-top: 20px; width: 100%; grid-column: 1 / -1; }

.pin-container {
    column-count: 5; column-gap: 15px; width: 100%;
}
@media (max-width: 1400px) { .pin-container { column-count: 4; } }
@media (max-width: 1100px) { .pin-container { column-count: 3; } }
@media (max-width: 750px) { 
    .pin-container { column-count: 2; } 
    header { padding: 15px; flex-direction: column; gap: 15px; } 
    .search-box { width: 100%; } 
}

.skeleton-card {
    background-color: #0a0a0a; border-radius: 16px; margin-bottom: 15px;
    border: 1px solid #1a0000; position: relative; overflow: hidden;
    break-inside: avoid;
}
.skeleton-card::before {
    content: ""; position: absolute; top: 0; left: -150%; width: 150%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.08), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { left: -150%; }
    100% { left: 150%; }
}

.pin-card {
    background: #0a0a0a; margin-bottom: 15px; break-inside: avoid; border-radius: 16px;
    overflow: hidden; border: 1px solid #1a0000; transition: transform 0.3s ease, border-color 0.3s;
    cursor: pointer;
}
.pin-card:hover { transform: translateY(-5px); border-color: #ff0000; box-shadow: 0 8px 25px rgba(255, 0, 0, 0.35); }

.pin-card img {
    width: 100%; display: block; height: auto;
    opacity: 0; transform: scale(0.95); transition: opacity 0.5s ease, transform 0.5s ease;
}
.pin-card img.loaded { opacity: 1; transform: scale(1); }

.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lightbox img {
    max-width: 90%; max-height: 90vh; border-radius: 12px;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.4); border: 2px solid #220000;
}

.floating-btn {
    position: absolute; top: 30px; left: 30px; background: transparent;
    border: none; color: #fff; cursor: pointer; transition: 0.3s; z-index: 10000;
    padding: 10px; border-radius: 50%;
}
.floating-btn:hover { color: #ff0000; transform: scale(1.15); filter: drop-shadow(0 0 10px #ff0000); }
