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

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    z-index: -1;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Components */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: white;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: white;
    outline: none;
    transition: var(--transition);
    appearance: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

select option {
    background-color: white;
    color: black;
}

/* Grid for Docs */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.doc-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.doc-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.doc-card:hover::after {
    transform: scaleX(1);
}

.doc-thumbnail {
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.doc-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.doc-thumbnail canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.doc-thumbnail i {
    font-size: 2.8rem;
    color: var(--primary);
    transition: var(--transition);
}

.doc-card:hover .doc-thumbnail i {
    transform: scale(1.1);
    opacity: 1;
}

/* File Type Colors */
.type-pdf { color: #ef4444 !important; }
.type-word { color: #2b579a !important; }
.type-ppt { color: #d24726 !important; }
.type-excel { color: #217346 !important; }
.type-image { color: #3b82f6 !important; }
.type-default { color: var(--text-muted) !important; }

.file-ext-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.4rem;
    background: rgba(0,0,0,0.5);
    border-radius: 0.3rem;
    color: white;
    text-transform: uppercase;
}

.doc-info h3 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.doc-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .doc-grid { grid-template-columns: 1fr; }
}

/* Preview Modal */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.preview-header {
    height: 60px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.preview-content {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-error {
    text-align: center;
    color: white;
}
