/* TRINITY.CSS - Application Page Styles */
/* Cleaned up - removed unused rules, standardized navbar with index.css */

/* ============================================
   BASE BODY STYLES
   ============================================ */
body {
    background: linear-gradient(135deg, #fcfcfc 0%, #ffffff 100%);
    min-height: 100vh;
    padding-top: 60px;
    font-family: 'Arimo', sans-serif;
    color: inherit;
}

/* ============================================
   NAVBAR STYLES (STANDARDIZED WITH INDEX.CSS)
   Only difference: blue gradient background instead of transparent/sticky
   ============================================ */
.main_h {
  position: fixed !important;
  top: 0px !important;
  max-height: 40px !important;
  z-index: 999;
  width: 100% !important;
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  background: linear-gradient(90deg, #2575fc 0%, #1a5a9e 45%, #1a5a9e 55%, #2575fc 100%);
  overflow: hidden !important;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  opacity: 1 !important;
  font-family: "Arimo", sans-serif;
  border-radius: 0 0 0.5rem 0.5rem;
}

@media only screen and (max-width: 768px) {
  .main_h {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

.open-nav {
  max-height: 400px !important;
}

.logo {
  width: 50px;
  font-size: 25px;
  color: #e2e2e2;
  text-transform: uppercase;
  float: left;
  display: block;
  margin-top: 0;
  line-height: 1;
  margin-bottom: 10px;
  text-decoration: none !important;
}

@media only screen and (max-width: 768px) {
  .logo {
    margin-top: 0;
    float: none;
    display: flex;
    align-items: center;
    height: 100%;
  }
}

nav {
  float: right;
  width: 60%;
}

@media only screen and (max-width: 768px) {
  nav {
    width: 100%;
  }
}

nav ul {
  margin-top: 0;
  margin-bottom: 0;
  list-style: none;
  overflow: hidden;
  text-align: right;
  float: right;
}

@media only screen and (max-width: 768px) {
  nav ul {
    margin-bottom: 22px;
    float: left;
    text-align: center;
    width: 100%;
  }
}

nav ul li {
  display: inline-block;
  margin-left: 35px;
  line-height: 1.5;
}

@media only screen and (max-width: 768px) {
  nav ul li {
    width: 100%;
    padding: 7px 0;
    margin: 0;
  }
}

nav ul a,
nav ul button {
  color: #e2e2e2;
  text-transform: uppercase;
  font-size: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-family: "Arimo", sans-serif;
}

.mobile-toggle {
  display: none;
  cursor: pointer;
  font-size: 20px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  -webkit-transition: all 200ms ease-in;
  -moz-transition: all 200ms ease-in;
  transition: all 200ms ease-in;
}

@media only screen and (max-width: 768px) {
  .mobile-toggle {
    display: block;
    right: 0;
  }
}

.mobile-toggle i {
  color: #e2e2e2;
  font-size: 24px;
}

.main_h .row {
  width: 100% !important;
  max-width: 940px !important;
  margin: 0 auto !important;
  position: relative !important;
  padding: 0 2% !important;
  --bs-gutter-x: 0 !important;
  --bs-gutter-y: 0 !important;
  display: block !important;
}

/* Mobile - remove padding to allow hamburger to reach edge */
@media only screen and (max-width: 768px) {
  .main_h .row {
    padding: 0 !important;
  }
}

/* Desktop only - full width navbar */
@media only screen and (min-width: 769px) {
  .main_h .row {
    max-width: 100% !important;
    padding: 0 4% !important;
  }

  .main_h .logo {
    width: auto !important;
  }

  .main_h nav {
    width: auto !important;
  }
}

/* ============================================
   TRINITY MAIN CONTENT
   ============================================ */
.main-wrapper {
    min-width: 90vw;
}

.main-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header-section {
    background: linear-gradient(90deg, #0f356a 0%, #2575fc 50%, #0f356a 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header-section h1 {
    text-shadow: 0 0 30px rgba(255, 255, 255, 1.2);
}

.header-section .header-icon {
    width: 48px;
    height: 48px;
    vertical-align: middle;
}

.stats-section {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.stats-item {
    text-align: center;
    padding: 0.5rem;
}

.stats-item small {
    line-height: 1.5;
    display: block;
    margin-top: 0;
    margin-bottom: 0;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2575fc;
}

/* Desktop only - larger metrics numbers */
@media (min-width: 769px) {
    .stats-number {
        font-size: 2.25rem;
    }
}

.btn-custom {
    background: #1a5ec9;
    border: 1px solid #4a8ade;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    background: #1a5ec9;
    border: 1px solid #4a8ade;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.result-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 200px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

/* Search results box - match left column height */
#search-results {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Set specific height to match left column content */
@media (min-width: 768px) {
    #search-processing .col-md-4 .result-box {
        height: 320px;
    }
}

.loading {
    display: none;
}

.tab-content {
    margin-top: 2rem;
}

/* ============================================
   TAB STYLING
   ============================================ */
#processingTabs {
    border-bottom: none;
    margin-bottom: 0;
    display: flex;
    flex-wrap: nowrap;
}

#processingTabs .nav-item {
    padding: 0 0.2rem;
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
}

#processingTabs .nav-link {
    border: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.65rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    background: #e2e6ea;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#processingTabs .nav-link i {
    font-size: 1.1rem;
}

#processingTabs .nav-link:hover:not(.active) {
    background: #d3d8dd;
    color: #212529;
}

#processingTabs .nav-link.active {
    background: #1a5ec9;
    color: white;
    border: 1px solid #4a8ade;
    border-bottom: none;
}

#processingTabs .nav-link.active i {
    color: white;
}

.file-input-group {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-input-group:hover {
    border-color: #6a11cb;
    background-color: #f8f9fa;
}

/* Tab text display - default desktop */
.tab-short {
    display: none;
}

.tab-full {
    display: inline;
}

/* Responsive font sizing for medium screens (tablets) */
@media (max-width: 1200px) and (min-width: 769px) {
    #processingTabs .nav-link {
        font-size: 0.85rem;
        padding: 0.65rem 0.4rem;
    }
    #processingTabs .nav-link i {
        font-size: 1rem;
    }
}

/* Mobile responsive spacing */
@media (max-width: 768px) {
    .mobile-btn-spacing {
        margin-bottom: 1rem;
    }
    /* Show shortened tab text on mobile */
    #processingTabs .nav-link {
        padding: 0.65rem 0.3rem;
        font-size: 0.75rem;
    }
    #processingTabs .nav-link i {
        font-size: 0.9rem;
    }
    .tab-short {
        display: inline;
    }
    .tab-full {
        display: none;
    }
    /* Add spacing between search input and button on mobile */
    #search-query {
        margin-bottom: 1rem;
    }
}

/* Extra small screens - even more compact */
@media (max-width: 480px) {
    #processingTabs .nav-link {
        padding: 0.5rem 0.2rem;
        font-size: 0.7rem;
    }
    #processingTabs .nav-link i {
        font-size: 0.85rem;
        margin-right: 0.1rem !important;
    }
}

/* ============================================
   FILE TYPE BADGES
   ============================================ */
.file-type-badge {
    display: inline-block;
    background: #1a5ec9;
    color: white;
    padding: 0.3rem 0.7rem;
    margin: 0.25rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    min-width: 5rem;
    text-align: center;
    border: 1px solid #4a8ade;
}

.file-type-badge:hover {
    background: #1a5ec9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    text-decoration: none;
    border: 1px solid #4a8ade;
}

.supported-formats {
    margin-top: 1rem;
    text-align: center;
}

.intro-wrapper {
    margin-top: 30px;
    text-align: center;
    margin-bottom: 40px;
    opacity: 0.6;
}

.intro-wrapper .home-btn {
    margin-right: 10vw;
}

.intro-wrapper .faq-btn {
    margin-left: 10vw;
}

.arimo-font {
    font-family: 'Arimo', sans-serif;
}

.hidden-file-input {
    display: none;
}

.alert-success-custom {
    display: none;
}

.copy-btn-hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* ============================================
   CUSTOM FILE INPUT STYLES
   ============================================ */
.custom-file-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    color: white;
}

.custom-file-input.process-style {
    background: linear-gradient(90deg, #0f356a 0%, #2575fc 50%, #0f356a 100%);
}

.custom-file-input.process-style:hover {
    background: linear-gradient(90deg, #0f356a 0%, #2575fc 50%, #0f356a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.custom-file-input.revert-style {
    background: white;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.custom-file-input.revert-style:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Hide the file input's default text */
.custom-file-input::-webkit-file-upload-button {
    display: none;
}

.custom-file-input::file-selector-button {
    display: none;
}

/* Custom text for file inputs */
.custom-file-input::before {
    content: attr(data-label);
    display: inline-block;
    white-space: nowrap;
}

/* Custom file input wrapper */
.custom-file-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-chosen-text {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.file-count-text {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.custom-file-btn {
    background: #1a5ec9;
    color: white;
    border: 1px solid #4a8ade;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.custom-file-btn:hover {
    background: #1a5ec9;
    color: white;
    border: 1px solid #4a8ade;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.btn-main-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.btn-sub-text {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Desktop - keep on single line */
@media (min-width: 769px) {
    .btn-main-text {
        display: inline;
    }

    .btn-sub-text {
        display: inline;
        margin-top: 0;
        margin-left: 0.25rem;
    }
}

/* Mobile - stack text */
@media (max-width: 768px) {
    .btn-main-text {
        display: block;
    }

    .btn-sub-text {
        display: block;
        margin-top: 0.25rem;
    }
}

/* ============================================
   FAQ MODAL STYLES
   ============================================ */
#faqCarousel .carousel-item {
    min-height: 420px;
}

#faqCarousel .carousel-item .p-3 {
    min-height: 380px;
}

/* Mobile FAQ Modal - 80% screen height */
@media (max-width: 768px) {
    #faqModal .modal-dialog {
        margin: 0;
        width: 90vw;
        max-width: 90vw;
        height: 80vh;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #faqModal .modal-content {
        height: 80vh;
        border-radius: 0.5rem;
    }

    #faqModal .modal-body {
        flex: 1;
        overflow-y: auto;
    }

    #faqCarousel .carousel-item {
        min-height: 0;
        height: 100%;
    }

    #faqCarousel .carousel-inner {
        height: 100%;
    }
}

.demo-section {
    padding: 2rem;
}

/* ============================================
   FILE LOADING OVERLAY
   ============================================ */
.file-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-loading-content {
    background: linear-gradient(135deg, #0f356a 0%, #2575fc 50%, #0f356a 100%);
    padding: 3rem 4rem;
    border-radius: 0.5rem;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 90vw;
}

.file-loading-content i {
    color: white;
}

.file-loading-content h5 {
    color: white;
    margin: 0;
}

.file-loading-content .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    margin: 0;
}

@media (max-width: 768px) {
    .file-loading-content {
        padding: 2rem 2.5rem;
    }
}

/* ============================================
   MOBILE PADDING REDUCTION (75%)
   ============================================ */
@media (max-width: 768px) {
    /* Removed padding-right to allow hamburger to reach edge */

    /* Main container */
    .container {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Hero section */
    .hero-section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Header section - preserve border radius */
    .header-section {
        border-radius: 0.5rem 0.5rem 0 0 !important;
    }

    /* Stats section */
    .stats-section {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Card/Box elements */
    .card, .main-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Result boxes */
    .result-box {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Text search results - smaller on mobile */
    #text-search-results {
        min-height: 360px !important;
    }

    /* Buttons */
    .btn, .custom-file-btn {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Tab navigation */
    #processingTabs .nav-link {
        padding-left: 0.125rem !important;
        padding-right: 0.125rem !important;
    }

    /* Demo section */
    .demo-section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* File loading overlay content */
    .file-loading-content {
        padding-left: 0.625rem !important;
        padding-right: 0.625rem !important;
    }

    /* File type badges */
    .file-type-badge {
        padding-left: 0.175rem !important;
        padding-right: 0.175rem !important;
    }

    /* General padding overrides */
    .p-3 {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }

    .px-3 {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }

    .px-4 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* ============================================
   POPUP/OVERLAY STYLES (MATCHING INDEX.CSS)
   ============================================ */
.logo-popup-btn {
	font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
	width: 80px;
	height: 80px;
	cursor: pointer;
	object-fit: contain;
	display: inline-block;
}

.logo-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.logo-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
}

.logo-popup-content {
	position: relative;
	z-index: 2;
	width: 70vw;
	height: 80vh;
	max-width: 900px;
	max-height: 90vh;
	background: rgba(0,0,0,0.7);
	border: none;
	outline: none;
	border-radius: 0.5rem;
	padding: 24px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.3);
	overflow: auto;
	color: #fff;
	text-align: center;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.logo-popup-content:focus {
	outline: none;
}

.logo-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #fff;
}

.logo-popup-title {
	margin-top: 6px;
	font-size: 2rem;
	text-align: center;
	color: #fff;
}

.logo-popup-body {
	margin-top: 1rem;
	font-size: 1rem;
	line-height: 1.6;
	color: #fff;
	text-align: center;
}

.logo-popup-note {
	margin-bottom: 0;
}

.logo-popup-footer {
	display: flex;
	justify-content: center;
	padding-top: 18px;
}

.logo-popup-thank {
	background: #fff;
	color: #000;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.logo-popup-thank:active {
	transform: translateY(1px);
}

/* Show full version on desktop, hide mobile version */
.logo-popup-full {
	display: block;
}

.logo-popup-mobile {
	display: none;
}

@media (max-width:900px) {
	/* Hide full version on mobile, show mobile version */
	.logo-popup-full {
		display: none;
	}
	.logo-popup-mobile {
		display: block;
	}

	.logo-popup-content {
		width: 95vw;
		height: auto;
		max-height: 85vh;
		padding: 1.5rem 1.25rem;
		overflow-y: auto;
	}

	.logo-popup-title {
		margin-top: 0;
		margin-bottom: 1.5rem;
		font-size: 1.5rem;
	}

	.logo-popup-body {
		margin-top: 0;
		margin-bottom: 1.5rem;
		font-size: 0.9rem;
		line-height: 1.5;
	}

	.logo-popup-body p {
		margin-bottom: 1rem;
	}

	.logo-popup-footer {
		margin-top: 1.5rem;
		padding-top: 1rem;
	}
}

/* Popup visibility and transitions */
.logo-popup-overlay {
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease-in-out;
}

.logo-popup-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.logo-popup-content {
	transform: translateY(8px) scale(0.995);
	transition: transform 220ms cubic-bezier(.2,.9,.3,1), opacity 220ms ease-in-out;
	opacity: 0;
}

.logo-popup-overlay.is-open .logo-popup-content {
	transform: translateY(0) scale(1);
	opacity: 1;
}
