/* PicPulse - Main Stylesheet
   Modern image hosting platform design
   No focus rings per user request */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    --color-bg: #0f0f13;
    --color-bg-secondary: #1a1a24;
    --color-bg-tertiary: #24243a;
    --color-bg-card: #1e1e30;
    --color-surface: #2a2a42;
    --color-border: #363654;
    --color-border-light: #4a4a6a;
    --color-text: #e8e8f0;
    --color-text-secondary: #a0a0b8;
    --color-text-muted: #6e6e8a;
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-primary-glow: rgba(99, 102, 241, 0.3);
    --color-secondary: #ec4899;
    --color-secondary-hover: #f472b6;
    --color-success: #22c55e;
    --color-success-bg: rgba(34, 197, 94, 0.1);
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-danger-hover: #f87171;
    --gradient-primary: linear-gradient(135deg, #6366f1, #ec4899);
    --gradient-bg: linear-gradient(180deg, #0f0f13 0%, #1a1a2e 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--color-primary-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* NO FOCUS RINGS - Per user requirement */
*:focus {
    outline: none !important;
}

*:focus-visible {
    outline: none !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: rgba(15, 15, 19, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

.logo:hover {
    color: var(--color-text);
}

.logo-icon {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main {
    flex: 1;
    padding: 40px 0;
}

/* ============================================
   UPLOAD SECTION
   ============================================ */
.upload-hero {
    text-align: center;
    margin-bottom: 48px;
}

.upload-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-hero p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

.upload-area {
    background: var(--color-bg-card);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.upload-area:hover::before,
.upload-area.dragover::before {
    opacity: 0.05;
}

.upload-area.dragover {
    border-color: var(--color-primary);
    transform: scale(1.01);
}

.upload-icon {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.upload-icon svg {
    filter: drop-shadow(0 0 20px var(--color-primary-glow));
}

.upload-text {
    position: relative;
    z-index: 1;
}

.upload-text h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.upload-text p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.upload-text .browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.upload-text .browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--color-primary-glow);
    color: white;
}

.upload-constraints {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ============================================
   UPLOAD PROGRESS
   ============================================ */
.upload-progress-section {
    margin-top: 32px;
    display: none;
}

.upload-progress-section.visible {
    display: block;
}

.progress-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-item .file-info {
    flex: 1;
    min-width: 0;
}

.progress-item .file-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-item .file-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--color-surface);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.progress-status.success {
    color: var(--color-success);
}

.progress-status.error {
    color: var(--color-danger);
}

/* ============================================
   UPLOAD RESULTS
   ============================================ */
.upload-results {
    margin-top: 32px;
    display: none;
}

.upload-results.visible {
    display: block;
}

.result-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.result-preview {
    background: var(--color-surface);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
}

.result-preview img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.result-links {
    padding: 20px;
}

.result-links h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}

.link-group {
    margin-bottom: 12px;
}

.link-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.link-input-group {
    display: flex;
    gap: 8px;
}

.link-input {
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--color-text);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    transition: border-color var(--transition);
}

.link-input:focus {
    border-color: var(--color-primary);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: var(--color-success);
}

.result-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    margin-top: 16px;
}

.delete-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.delete-link:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger-hover);
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.gallery-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.gallery-count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    group: true;
}

.gallery-item:hover {
    border-color: var(--color-border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-info {
    padding: 12px 14px;
}

.gallery-item-name {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.gallery-item-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gallery-item-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   IMAGE VIEW PAGE
   ============================================ */
.image-view {
    max-width: 900px;
    margin: 0 auto;
}

.image-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.image-view-title {
    font-size: 1.3rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.image-view-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.image-view-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.image-view-main {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.image-view-main img {
    width: 100%;
    display: block;
}

.image-view-links {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.image-view-links h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.image-view-links .link-group {
    margin-bottom: 16px;
}

.image-view-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* ============================================
   DELETE PAGE
   ============================================ */
.delete-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.delete-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.delete-card .delete-icon {
    margin-bottom: 20px;
}

.delete-card h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.delete-card p {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.delete-preview {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 300px;
}

.delete-preview img {
    width: 100%;
    object-fit: contain;
    max-height: 300px;
    background: var(--color-surface);
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
}

.delete-btn:hover {
    background: var(--color-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    color: white;
}

.delete-success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--color-success);
    font-weight: 500;
    display: none;
}

.delete-success.visible {
    display: block;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

.empty-state p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.empty-state a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}

.empty-state a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--color-primary-glow);
    color: white;
}

/* ============================================
   ALBUM VIEW
   ============================================ */
.album-view {
    max-width: 1200px;
    margin: 0 auto;
}

.album-header {
    margin-bottom: 32px;
}

.album-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.album-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.album-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.album-description {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 800px;
}

.album-links {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

/* ============================================
   CREATE ALBUM
   ============================================ */
.create-album-page {
    max-width: 600px;
    margin: 0 auto;
}

.create-album-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 20px;
    width: 100%;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: rgba(15, 15, 19, 0.8);
    border-top: 1px solid var(--color-border);
    padding: 32px 0;
    margin-top: auto;
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.footer-text {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ============================================
   BUTTONS & FORMS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--color-primary-glow);
    color: white;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(50px); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .upload-hero h1 {
        font-size: 1.8rem;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }

    .header-inner {
        gap: 12px;
    }

    .nav-link span {
        display: none;
    }

    .image-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-actions {
        flex-direction: column;
    }

    .link-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-link {
        padding: 8px 10px;
    }

    .image-view-links {
        padding: 16px;
    }
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-bg-tertiary) 50%, var(--color-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border);
}