/* ######################################################### */
/* Admin-LOGIN & Standalone (Secretlnk) */
/* ######################################################### */

body.standalone-body {
	font-family: Nunito, Arial, Helvetica, sans-serif;
	color: var(--text-dark);
	font-size: clamp(0.9rem, 2vh, 1.5rem);
	margin: 0; 
	padding: 0;
}

body.standalone-body::before {
	content: "";
	position: fixed;
	top: -10%; 
	left: -10%; 
	width: 120%; 
	height: 120%; 
	z-index: -1;
	filter: blur(8px);
	transform: scale(1.1);
}

.standalone-body .modal-admin-standalone {
	display: block !important;
}

.standalone-body .modal-content-admin {
	border-color: var(--border-primary) !important;
	height: auto !important;
	margin: 0 auto !important;
}

.standalone-body .auto-height {
	padding: 25px 20px !important;
	height: auto !important;
	display: block !important;
}

.standalone-body #message_container {
	display: block;
	width: 100%;
}

.standalone-body .logintextarea {
	box-sizing: border-box;
	margin: 0 0 20px 0 !important;
	width: 100%;
	min-height: 80px;
	max-height: 55vh;
	resize: none !important;
	overflow-y: auto !important;
	display: block;
}

.standalone-body .msg-text {
	text-align: center;
	font-weight: bold;
	margin: 0;
	padding: 10px 0;
	display: block;
	width: 100%;
}

.standalone-body .download-custom {
	display: inline-flex;
	align-items: center;
	gap: 15px;
	text-decoration: underline;
	color: var(--text-link);
	font-weight: bold;
	font-size: 1.2em;
	margin-bottom: 20px;
	transition: all 0.3s ease;
}

.standalone-body .download-custom:hover {
	opacity: 0.8;
	color: var(--primary-color);
}

.standalone-body .download-custom img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.standalone-body #geheim_anhang_img {
	transition: transform 0.5s ease, opacity 1s linear;
	margin-top: 30px;
	margin-bottom: 90px;
	display: block;
}

.standalone-body #geheim_anhang_img:hover {
	transform: scale(1.25);
}

@media screen and (max-width: 768px) {
	.standalone-body .modal-admin-standalone {
		padding-top: 0 !important;
	}

	.standalone-body .modal-content-admin {
		width: 96% !important;
		margin: 20px auto !important;
		height: auto !important;
		max-height: calc(100vh - 40px) !important;
		max-height: calc(100dvh - 40px) !important;
		display: flex !important;
		flex-direction: column !important;
	}

	.standalone-body .modal-content-admin.info-only {
		height: auto !important;
		display: block !important;
	}

	.standalone-body .auto-height {
		display: flex !important;
		flex-direction: column !important;
		flex: 1 1 auto;
		min-height: 0;
	}

	.standalone-body .modal-content-admin.info-only .auto-height {
		display: block !important;
	}

	.standalone-body #message_container {
		display: flex !important;
		flex-direction: column !important;
		flex: 1 1 auto;
		min-height: 0;
		justify-content: center;
	}

	.standalone-body .modal-content-admin.info-only #message_container {
		display: block !important;
	}

	.standalone-body .logintextarea {
		flex: 0 1 auto !important;
		min-height: 0 !important;
		max-height: none !important;
	}
}

/* ######################################################### */
/* Status-Container & Login Symmetrie */
/* ######################################################### */

.status-container {
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin: 0.2% 0 0.2% 0; /* Symmetrischer Abstand nach oben und unten */
}

/* Symmetrie-Korrektur für Login-Modale: Padding am Container entfernen */
.modal-content-C .container,
.modal-content-C .login-grid {
    padding-bottom: 0 !important;
}

/* Überschreibt den Standard-Abstand aus style.css für Login-Buttons */
.modal-content-C button[type=submit] {
    margin: 20px 0 0 0 !important; /* Nur Abstand nach oben zum Formular, 0 nach unten zum Statuscontainer */
}

/* ######################################################### */
/* Modal Admin Logged-In & Tab-Bereich */
/* ######################################################### */

@media screen and (min-width: 769px) {
    .modal-admin-logged-in[style*="display: block"],
    .modal-admin-logged-in[style*="display:block"] {
        display: flex !important;
        justify-content: center;
        align-items: center;
        padding: 100px 0 !important;
        box-sizing: border-box;
        height: 100vh !important;
    }
    .modal-admin-logged-in .modal-content-admin {
        margin: 0 auto !important;
        height: 100% !important;
        max-height: none !important;
        display: flex;
        flex-direction: column;
    }
    .modal-admin-logged-in .tab-admin.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    .modal-admin-logged-in .modal-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    .modal-admin-logged-in .saveForm,
    .modal-admin-logged-in .g-full-width {
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    .modal-admin-logged-in .logintextarea {
        flex: 1;
        height: auto !important;
        max-height: none !important;
    }
}

.modal-body {
    padding-left: 1% !important;
    padding-right: 1% !important;
}

/* Footer-Bereich mit Buttons */
.modal-tab-footer {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0 1% 2% 1%;
}

.modal-tab-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 96%;
    margin: 0 auto;
}

.cancel-btn-wrapper {
    display: flex;
    flex: 1;
    justify-content: flex-start;
    margin: 0 !important;
}

.switch-wrapper {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    height: 55px;
    flex-shrink: 0;
    margin: 0.2% 0 0.2% 0;
}

.save-btn-wrapper {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    position: relative;
    margin: 0 !important;
}

/* Benutzername ausblenden */
#tab-notiz .username,
#tab-geheim .username,
.tab-admin .username,
div.username {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Tastschalter Ansicht Button */
.tastschalter-ansicht {
    font-weight: bold;
    border: 1px solid var(--input-border);
    font-size: 34px;
    line-height: 40px;
    width: 40px;
    height: 40px;
    text-align: center;
    border-radius: 25px;
    color: var(--close-text);
    background: var(--close-bg);
    box-shadow: 0 6px 6px var(--shadow-strong);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.tastschalter-ansicht:hover,
.tastschalter-ansicht:focus {
    color: var(--accent-hover);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    box-shadow: 0 6px 15px rgba(128, 0, 0, 0.6);
    transform: scale(1.2);
}

.tab-admin {
    position: relative;
    display: none;
}

/* ######################################################### */
/* Modal Maximieren (Toggle) */
/* ######################################################### */

.modal-admin.is-maximized-modal {
    padding: 0 !important;
}

.modal-admin.is-maximized-modal .modal-content-admin,
.modal-admin.is-maximized-modal .modal-content-C,
.modal-admin.is-maximized-modal .modal-content-B {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
}

.modal-admin.is-maximized-modal .modal-head {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.modal-admin.is-maximized-modal .modal-body {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ######################################################### */
/* Struktur & Optionen (Secret Tab) */
/* ######################################################### */

.secret-status-wrapper {
    width: 96%;
    margin: 0.2% auto; /* Symmetrischer Abstand oben/unten */
    height: 55px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

@media screen and (max-width: 768px) {
    .secret-status-wrapper {
        width: 96%; 
        height: 48px;
    }
}

/* ######################################################### */
/* Einheitliche Statusmeldungen (Success / Error)            */
/* ######################################################### */

.success-box,
.error-box {
    width: fit-content !important;
    max-width: 96%;
    margin: 10px auto !important; 
    padding: 8px 25px !important;
    box-sizing: border-box;
    border-radius: 5px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1.4 !important;
    text-align: center !important;
    font-family: Arial, sans-serif !important;
    text-shadow: none !important;
    display: block;
}

.success-box {
    background-color: rgba(21, 87, 36, 0.15) !important;
    color: #155724 !important;
    border: 1px solid rgba(21, 87, 36, 0.4) !important;
}

.error-box {
    background-color: rgba(220, 53, 69, 0.15) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.4) !important;
}

.secret-status-wrapper .success-box,
.secret-status-wrapper .error-box,
.status-container .success-box,
.status-container .error-box {
    margin: 0 auto !important; 
}

@media screen and (max-width: 768px) {
    .success-box,
    .error-box {
        font-size: 14px !important;
        padding: 6px 15px !important;
    }
}

#tab-geheim .url-row {
    margin: 0 auto 2% auto !important;
    align-items: center;
    flex-shrink: 0;
    width: 96%;
    flex-wrap: wrap;
    display: flex;
}

#tab-geheim .url-row .header-btn {
    height: 44px;
    padding: 0 15px !important;
    box-sizing: border-box;
    width: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 !important;
}

#tab-geheim .url-row .picker-input {
    flex-grow: 1;
    margin: 0;
    height: 44px;
    box-sizing: border-box;
    text-align: left;
    padding-left: 12px;
}

#tab-geheim .content-row {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 96%;
    margin: 0 auto !important;
    min-height: 0;
    gap: 0;
}

#tab-geheim .options-row {
    display: flex;
    width: 96%;
    align-items: flex-end;
    margin: 0.5% auto 3% auto !important;
    flex-shrink: 0;
    gap: 10px;
}

.options-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.options-col label {
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-dark);
    text-align: center;
}

.slider-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 130px;
    border: 1.5px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    height: 35px;
    box-sizing: border-box;
    box-shadow: 4px 4px 8px var(--shadow-light);
}

.grid-sendimage {
    margin-bottom: 5px;
}

#geheim_fileinfo {
    width: 100%;
    margin-top: 4px;
    font-size: 0.75em;
    color: var(--text-dark);
    min-height: 1.5em;
    flex-shrink: 0;
    text-align: left;
}

#geheim_fileinfo:empty {
    min-height: 0;
    margin-top: 0;
}

button.secret-option-btn {
    background-color: var(--glass-accent) !important;
    background-image: none !important;
    border: 1px solid var(--accent-color) !important;
    border-radius: 6px !important;
    font-family: Yanone Kaffeesatz, Arial, Helvetica, sans-serif !important;
    font-size: 1.1em !important;
    font-weight: bold !important;
    color: var(--text-light) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 4px 10px var(--shadow-accent) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    padding: 4px 16px !important;
    height: auto !important;
    min-height: 35px !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

button.secret-option-btn:hover {
    background-color: var(--glass-accent-hover) !important;
    box-shadow: 0 6px 15px rgba(128, 0, 0, 0.7) !important;
    transform: scale(1.02) !important;
    border-color: var(--border-hover) !important;
}

button.secret-option-btn.btn-active-state {
    background-color: var(--glass-accent-hover) !important;
    box-shadow: 0 4px 10px var(--shadow-accent) !important;
    border-color: var(--border-hover) !important;
}

button#btn_loeschung {
    width: 235px !important;
}

button#btn_lesebestaetigung {
    width: 190px !important;
}

button.btn-aufrufe {
    cursor: pointer !important;
    color: var(--border-primary) !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s ease, transform 0.1s ease !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    border-radius: 0 !important;
}

button.btn-aufrufe:hover {
    color: var(--accent-color) !important;
    transform: scale(1.15) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.aufrufe-container {
    position: relative;
    width: 40px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.aufrufe-number {
    position: absolute;
    font-weight: bold;
    color: var(--text-dark);
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right { transform: translateX(20px) scale(0.5); opacity: 0; }
.slide-in-left { transform: translateX(-20px) scale(0.5); opacity: 0; }
.slide-out-left { transform: translateX(-20px) scale(0.5); opacity: 0; }
.slide-out-right { transform: translateX(20px) scale(0.5); opacity: 0; }
.slide-center { transform: translateX(0) scale(1); opacity: 1; }

.secretname {
    width: 100%;
    margin: 0 auto -1.5px auto !important;
    position: relative;
    z-index: 2;
}

.secretname input {
    height: 1.5em !important;
    padding: 2px 10px !important;
    margin: 0 !important;
    border-radius: 5px 5px 0 0 !important;
    border-bottom: none !important;
    background-color: var(--input-bg) !important;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.secrettextarea {
    width: 100%;
    flex: 1;
    margin: 0 !important;
    box-sizing: border-box;
    min-height: 150px;
    border: 1.5px solid var(--input-border);
    border-top: none !important;
    border-radius: 0 0 5px 5px !important;
    background: var(--input-bg);
    color: var(--text-dark);
    padding: 6px;
    resize: vertical;
    font-family: Nunito, Arial, Helvetica;
    font-size: clamp(0.9rem, 2vh, 1.5rem);
    box-shadow: 4px 4px 8px var(--shadow-light);
    display: block;
}

.tab-admin .secrettextarea:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 8px var(--shadow-accent) !important;
    outline: none !important;
}

#save_secret.uploading {
    width: 180px !important;
}

@media screen and (max-width: 768px) {
    #save_secret.uploading {
        width: 110px !important;
    }
    
    #tab-geheim .options-row {
        margin-top: 10px !important;
    }
    
    .options-col label {
        margin-bottom: 2px !important;
    }
    
    button.secret-option-btn {
        white-space: normal !important;
        height: auto !important;
        min-height: 35px !important;
        padding: 4px 2px !important;
        font-size: 0.75em !important;
        line-height: 1.1 !important;
        width: 95% !important;
        word-wrap: break-word;
    }
    button#btn_loeschung {
        width: 95% !important;
    }
    button#btn_lesebestaetigung {
        width: 95% !important;
    }
    .slider-box {
        width: 80px !important;
    }
    button.btn-aufrufe {
        padding: 0 4px !important;
    }
    .desktop-text { display: none !important; }
    .mobile-text { display: block !important; line-height: 1.1; }
}

@media screen and (min-width: 769px) {
    .mobile-text { display: none !important; }
    .desktop-text { display: inline !important; }
}

/* --- Navigation Icons --- */
.img-only-tab {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    transition: transform 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.img-only-tab:hover, .img-only-tab.active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: scale(1.2) !important;
}
.img-only-tab img {
    height: 36px;
    width: 36px;
    object-fit: contain;
    display: block;
}

@media screen and (min-width: 769px) {
    .btn-logout-trigger {
        margin-right: 25px !important;
    }
}

.dropdown-item:hover {
    background-color: var(--glass-accent, #007bff);
    color: var(--text-light, #fff) !important;
}

/* ######################################################### */
/* Mobile Dropdown Z-Index & Overflow Fix                    */
/* ######################################################### */

#M02 .xcontainer {
    z-index: 10005 !important;
}

#M02 .modal-head,
#M02 .modal-head-tabs {
    position: relative !important;
    z-index: 9999 !important;
    overflow: visible !important;
}

#M02 #nav-mid-container,
#M02 #mobile-dropdown {
    position: relative !important;
    overflow: visible !important;
}

#M02 #tab-dropdown-menu {
    z-index: 10000 !important;
}

#M02 .tab-admin,
#M02 .modal-body {
    position: relative !important;
    z-index: 1 !important;
}

/* --- Secret Table Styles --- */
.secret-table-wrapper {
    width: 96%;
    flex: 1;
    min-height: 0;
    margin: 2% auto;
    overflow: auto;
    border: 1.5px solid var(--input-border);
    border-radius: 5px;
    box-shadow: 4px 4px 8px var(--shadow-light);
    background: var(--input-bg);
}
.secret-list-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    color: var(--text-dark);
    font-size: 0.9em;
    min-width: 650px;
    background-color: transparent;
}
.secret-list-table th, .secret-list-table td {
    border: 1.5px solid var(--input-border);
    padding: 4px 8px;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}
.secret-list-table th {
    height: 44px;
    background-color: var(--glass-accent);
    color: var(--text-light);
    font-family: Yanone Kaffeesatz, Arial, Helvetica, sans-serif;
    font-size: 1.2em;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}
.secret-list-table th:nth-child(1) { width: 80px; }
.secret-list-table th:nth-child(2) { width: 60px; }
.secret-list-table th:nth-child(3) { width: 140px; }
.secret-list-table th:nth-child(4) { width: 100%; min-width: 50px; text-align: left; padding-left: 12px; }
.secret-list-table td:nth-child(4) { text-align: left; padding-left: 12px; }
.secret-list-table th:nth-child(5) { width: 70px; }
.secret-list-table th:nth-child(6) { width: 70px; }
.secret-list-table th:nth-child(7) { width: 90px; }
.secret-list-table th:nth-child(8) { width: 80px; }
.secret-list-table tbody tr.empty-row td {
    background-color: transparent;
}

/* ######################################################### */
/* Registrierung (reg.php) Spezifisch */
/* ######################################################### */

.modal-content-reg {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Oben ausgerichtet für konsistenten Flow */
    align-items: center;     
    width: 80%;              
    margin: 0 auto;          
    flex: 1;                 
}

.modal-content-reg .grid-form {
    width: 100%;
}

@media screen and (max-width: 768px) {
    .modal-content-reg {
        width: 96%; 
    }
}

.modal-content-reg input[type="checkbox"]#privacy::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='inner-grad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%239bd940' /%3E%3Cstop offset='100%25' stop-color='%2318863a' /%3E%3C/linearGradient%3E%3ClinearGradient id='bevel-grad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23c1f067' /%3E%3Cstop offset='100%25' stop-color='%2314752e' /%3E%3C/linearGradient%3E%3Cfilter id='shadow' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeDropShadow dx='2' dy='5' stdDeviation='3' flood-color='%230e5420' flood-opacity='0.6' /%3E%3C/filter%3E%3C/defs%3E%3Crect x='10' y='14' width='180' height='180' rx='40' fill='%231b8532' /%3E%3Crect x='10' y='10' width='180' height='180' rx='40' fill='%2342a838' /%3E%3Crect x='22' y='22' width='156' height='156' rx='30' fill='url(%23inner-grad)' /%3E%3Crect x='22' y='22' width='156' height='156' rx='30' fill='none' stroke='url(%23bevel-grad)' stroke-width='4' opacity='0.7'/%3E%3Cpath d='M 65 105 L 88 128 L 138 68' fill='none' stroke='%23f2f5f2' stroke-width='22' stroke-linecap='round' stroke-linejoin='round' filter='url(%23shadow)' /%3E%3C/svg%3E") !important;
    background-size: 115% !important;
    background-position: center !important;
}

/* ######################################################### */
/* 2FA Token Eingabe Höhenanpassung */
/* ######################################################### */

input#2fa_token_setup,
input#2fa_token_verify {
    text-align: center;
    font-size: 1.2em;
    letter-spacing: 2px;
    height: 2.5em !important;     
    padding: 4px 6px !important;  
    line-height: 1 !important;    
}

/* ######################################################### */
/* Crossfade Animation für Secret Views */
/* ######################################################### */

#tab-geheim.active {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

.secret-view {
    grid-area: 1 / 1 / 2 / 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1;
}

.secret-view.active-view {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ######################################################### */
/* 2FA Toggle Button in set.php anpassen auf reg.php Button-Größe */
/* ######################################################### */

button#btn_tfa_toggle {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 1.4em !important;
    margin: 0.5em 0 !important;
    white-space: normal !important;
    box-sizing: border-box !important;
    line-height: normal !important;
}