/* GDrive Viewer – Styles (v1.0.0) */

.gdv-wrapper {
	--gdv-olive: #67a671;
	--gdv-olive-dark: #4f8258;
	--gdv-cream: #fafae1;
	--gdv-dark: #313131;
	--gdv-gray: #6b6b6b;
	--gdv-radius: 14px;
	--gdv-shadow: 0 4px 18px rgba(49, 49, 49, 0.10);
	color: var(--gdv-dark);
	font-size: 16px;
	line-height: 1.5;
}

/* Suchfeld */
.gdv-search {
	margin: 0 0 1.4em;
}

.gdv-search-input {
	width: 100%;
	max-width: 420px;
	padding: 0.75em 1.1em;
	border: 2px solid #e4e4d4;
	border-radius: 999px;
	background: #fff;
	font-size: 0.95em;
	color: var(--gdv-dark);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gdv-search-input:focus {
	border-color: var(--gdv-olive);
	box-shadow: 0 0 0 4px rgba(103, 166, 113, 0.18);
}

/* Karten-Raster */
.gdv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 1.4em;
}

.gdv-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #ececdd;
	border-radius: var(--gdv-radius);
	box-shadow: var(--gdv-shadow);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gdv-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(49, 49, 49, 0.16);
}

/* Vorschaubild / Icon */
.gdv-card-thumb {
	position: relative;
	aspect-ratio: 16 / 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--gdv-cream);
	overflow: hidden;
}

.gdv-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gdv-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	height: 64px;
	padding: 0 12px;
	border-radius: 16px;
	background: var(--gdv-olive);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	box-shadow: 0 6px 14px rgba(103, 166, 113, 0.35);
}

.gdv-icon-pdf { background: #cf2e2e; box-shadow: 0 6px 14px rgba(207, 46, 46, 0.35); }
.gdv-icon-doc, .gdv-icon-docx { background: #2b579a; box-shadow: 0 6px 14px rgba(43, 87, 154, 0.35); }
.gdv-icon-xls, .gdv-icon-xlsx, .gdv-icon-csv { background: #217346; box-shadow: 0 6px 14px rgba(33, 115, 70, 0.35); }
.gdv-icon-ppt, .gdv-icon-pptx { background: #b7472a; box-shadow: 0 6px 14px rgba(183, 71, 42, 0.35); }
.gdv-icon-jpg, .gdv-icon-jpeg, .gdv-icon-png, .gdv-icon-gif, .gdv-icon-webp, .gdv-icon-svg { background: #8e6bbf; box-shadow: 0 6px 14px rgba(142, 107, 191, 0.35); }
.gdv-icon-mp4, .gdv-icon-mov { background: #3949ab; box-shadow: 0 6px 14px rgba(57, 73, 171, 0.35); }

.gdv-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(49, 49, 49, 0.75);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Karten-Inhalt */
.gdv-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1em 1.1em 1.15em;
}

.gdv-card-title {
	margin: 0 0 0.8em;
	font-size: 0.98em;
	font-weight: 600;
	line-height: 1.35;
	color: var(--gdv-dark);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.gdv-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: auto;
}

.gdv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5em 1.05em;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.gdv-btn:active { transform: scale(0.97); }

.gdv-btn-primary {
	background: var(--gdv-olive);
	border-color: var(--gdv-olive);
	color: #fff;
}

.gdv-btn-primary:hover {
	background: var(--gdv-olive-dark);
	border-color: var(--gdv-olive-dark);
	color: #fff;
}

.gdv-btn-ghost {
	background: transparent;
	border-color: var(--gdv-olive);
	color: var(--gdv-olive-dark);
}

.gdv-btn-ghost:hover {
	background: var(--gdv-cream);
	color: var(--gdv-dark);
}

.gdv-nopreview {
	font-size: 0.8em;
	color: var(--gdv-gray);
	align-self: center;
	font-style: italic;
}

/* Leer- / Fehlerzustand */
.gdv-empty {
	padding: 2.2em 1.6em;
	border: 2px dashed #d8d8c4;
	border-radius: var(--gdv-radius);
	background: var(--gdv-cream);
	text-align: center;
	color: var(--gdv-dark);
	font-size: 0.95em;
	line-height: 1.7;
}

.gdv-empty span { color: var(--gdv-gray); font-size: 0.9em; }

/* Lightbox / Vorschau-Modal */
.gdv-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 2.5vmin;
}

.gdv-modal.gdv-open { display: flex; }

.gdv-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(25, 25, 25, 0.72);
	backdrop-filter: blur(3px);
}

.gdv-modal-box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1000px, 96vw);
	height: min(82vh, 900px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
	overflow: hidden;
	animation: gdv-pop 0.18s ease;
}

@keyframes gdv-pop {
	from { opacity: 0; transform: scale(0.96) translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.gdv-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 0.7em 1em;
	border-bottom: 1px solid #eee;
	background: var(--gdv-cream);
}

.gdv-modal-title {
	font-weight: 700;
	font-size: 0.95em;
	color: var(--gdv-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gdv-modal-head-actions {
	display: flex;
	align-items: center;
	gap: 0.6em;
	flex-shrink: 0;
}

.gdv-modal-close {
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 50%;
	background: var(--gdv-dark);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.12s ease;
}

.gdv-modal-close:hover { background: var(--gdv-olive-dark); }
.gdv-modal-close:active { transform: scale(0.92); }

.gdv-modal-body {
	position: relative;
	flex: 1;
	background: #525659;
}

.gdv-modal-frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.gdv-modal-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 0.95em;
	letter-spacing: 0.03em;
	background: #525659;
	transition: opacity 0.3s ease;
}

.gdv-modal-loading.gdv-hidden {
	opacity: 0;
	pointer-events: none;
}

body.gdv-locked { overflow: hidden; }

/* Responsive */
@media (max-width: 600px) {
	.gdv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1em; }
	.gdv-card-body { padding: 0.85em 0.9em 1em; }
	.gdv-modal-box { height: 88vh; }
	.gdv-modal .gdv-modal-download { display: none; }
}
