/**
 * VR-Frases Main Stylesheet
 *
 * Comprehensive stylesheet for the VR-Frases plugin providing visual styling
 * for both admin panel and frontend components. This file includes advanced
 * component styling, form controls, table layouts, and responsive design
 * patterns for optimal user experience across all device types.
 *
 * Stylesheet organization:
 * - Advanced component integration (Select2, accordions, overlays)
 * - Form controls and input styling with focus states
 * - Data tables with sorting, pagination, and responsive behavior
 * - Message systems and notification styling
 * - Widget and card layouts for content display
 * - Responsive breakpoints and mobile optimization
 * - Admin interface specific styling and layout management
 *
 * @package     VR_Frases
 * @author      Vicente Ruiz Gálvez
 * @version     4.1.0
 * @license     GPL-2.0+
 */

/**
 * SECTION: SELECT2 INTEGRATION
 * Advanced selector styling with horizontal layout for multiple selections.
 * Optimized for themes selector and enhanced user experience.
 */
.select2-container--default .select2-selection--multiple {
	/* Include padding and border in width */
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;

	/* Spacing between elements */
	gap: 5px;

	/* Minimum height for alignment */
	min-height: 38px;

	/* Ensure it takes up the full width */
	width: 100%;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
	display: inline-block;

	/* Adjust margins */
	margin: 2px 0;

	/* Adjust padding */
	padding: 3px 10px;

	/* Prevent text from breaking */
	white-space: nowrap;
}

.select2-container {
	/* Ensure the container takes up the full width */
	width: 100% !important;
}

/**
 * SECTION: BASE ELEMENTS AND UTILITIES
 * Common element styling and utility classes used throughout the plugin.
 * Includes labels, borders, messages, and basic layout components.
 */
label {
	font-style: italic;
	font-weight: bold;
}

.acdc-label {
	color: #555;
	font-size: 0.9em;
	font-weight: bold;
	margin-left: 5px;
}

/* Utility classes for borders and emphasis. */
.borde-inferior {
	border-bottom: solid 2px;
	font-weight: bold;
}

.borde-superior {
	border-top: solid 2px;
	font-weight: bold;
}

/* Data display and information styling. */
.message-data {
	float: left;
	margin: 0;
}

.frases-num-items {
	align-items: center;
	color: #00a;
	display: flex;
	font-size: 1.15em;
	font-weight: bold;
	margin: 0 0 0 auto;
	min-height: 38px;
	padding: 2px 8px;
}

/* Search form layout and styling. */

.frases-queryform {
	align-items: center;
	border: 1px solid #adadad;
	border-radius: 5px;
	clear: both;
	display: flex;
	margin: 0;
	min-height: 38px;
	padding: 5px;
}

/* Results display container. */

.results-container {
	clear: both;
	margin: 15px 0;
}

.vr-table td {
	align-items: flex-end !important;
	border: 1px solid #ddd;
	padding: 8px;
	vertical-align: top;
}

.vr-table tr:nth-child(even) {
	background-color: #f9f9f9;
}

/* Pagination */
.vr-pagination {
	clear: both;
	margin: 15px 0;
	padding: 10px;
	text-align: center;
}

.vr-pagination a,
.vr-pagination span {
	background-color: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 3px;
	display: inline-block;
	margin: 0 3px;
	padding: 5px 10px;
	text-decoration: none;
}

.vr-pagination .current {
	background-color: #0073aa;
	color: #fff;
	font-weight: bold;
}

/* Messages */
.vr-message {
	border-radius: 3px;
	margin: 10px 0;
	padding: 10px;
}

.vr-message.success {
	background-color: #dff0d8;
	border: 1px solid #d6e9c6;
	color: #3c763d;
}

.vr-message.error {
	background-color: #f2dede;
	border: 1px solid #ebccd1;
	color: #a94442;
}

.vr-message.info {
	background-color: #d9edf7;
	border: 1px solid #bce8f1;
	color: #31708f;
}

/* Author details */
.author-details {
	background-color: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 3px;
	margin: 15px 0;
	padding: 15px;
}

.author-details h3 {
	border-bottom: 1px solid #ddd;
	margin-top: 0;
	padding-bottom: 5px;
}

.author-meta {
	margin-bottom: 10px;
}

/* Widgets */
.vr-widget {
	margin-bottom: 20px;
}

.vr-widget-title {
	font-weight: bold;
	margin-bottom: 8px;
}

.vr-widget-content {
	font-style: italic;
}

.vr-widget-author {
	font-size: 0.9em;
	margin-top: 5px;
	text-align: right;
}

/* Forms */
.vr-form {
	margin: 15px 0;
}

.vr-form-row {
	margin-bottom: 15px;
}

.vr-form-label {
	display: block;
	font-weight: bold;
	margin-bottom: 5px;
}

.vr-form input[type="text"],
.vr-form input[type="number"],
.vr-form textarea,
.vr-form select {
	border: 1px solid #ddd;
	border-radius: 3px;
	box-sizing: border-box;
	padding: 8px;
	width: 100%;
}

.vr-form textarea {
	min-height: 100px;
}

/* Buttons */
.vr-button {
	background-color: #0073aa;
	border: none;
	border-radius: 3px;
	color: #fff;
	display: inline-block;
	padding: 8px 15px;
	text-decoration: none;
}

.vr-button:hover {
	background-color: #005a87;
}

.vr-button.secondary {
	background-color: #f7f7f7;
	border: 1px solid #ccc;
	color: #555;
}

.vr-button.secondary:hover {
	background-color: #eaeaea;
}

/* Pagination - Using native WordPress styles with spacing improvements */

/* Improve spacing for pagination elements - specific to VR-Frases */
.vr-frases .tablenav-pages .button,
.vr-frases .tablenav-pages .tablenav-pages-navspan {
	margin-right: 8px !important;
}

/* Center the page input field */
.vr-frases .tablenav-pages .paging-input input.current-page {
	text-align: center !important;
}

/* Add spacing to 'of X' text and paging input container */
.vr-frases .tablenav-pages .paging-input {
	margin: 0 10px !important;
}

.vr-frases .tablenav-pages .tablenav-paging-text {
	margin-left: 6px !important;
	margin-right: 8px !important;
}

/* Ensure navigation buttons have consistent spacing */
.vr-frases .tablenav-pages .first-page,
.vr-frases .tablenav-pages .prev-page,
.vr-frases .tablenav-pages .next-page,
.vr-frases .tablenav-pages .last-page {
	margin-right: 8px !important;
}

/* Ensure disabled navigation spans have consistent spacing */
.vr-frases .tablenav-pages .tablenav-pages-navspan.disabled {
	margin-right: 8px !important;
}

/* Ensure last navigation button has proper spacing */
.vr-frases .tablenav-pages .button:last-child,
.vr-frases .tablenav-pages .tablenav-pages-navspan:last-child {
	margin-right: 0 !important;
}

/* Items counter - removed duplicate rule - using main definition at line 308 */

/* Highlighted element in search results */
.search-item {
	color: #00a;
	font-weight: bold;
}

/* Search form fields */
.search-box input[type="text"],
.search-box select {
	margin-bottom: 5px;
	margin-right: 8px;
	min-width: 150px;
}

/* Author details */
#vr-author-details {
	background: #f0f7ff;
	border: 1px solid #ccdcee;
	border-radius: 4px;
	clear: both;
	margin-bottom: 20px;
	padding: 10px;
}

#vr-author-details h3 {
	margin-top: 0;
}

#vr-author-details ul {
	margin: 0;
	padding-left: 20px;
}

/* Quote list */
#vr-quotes-list {
	clear: both;
	margin-top: 15px;

	/* Style for alternating rows */
	.wp-list-table tr:nth-child(even) {
	background-color: #f9f9f9;
	}
}

/* Pagination forms - specific to VR-Frases */
.vr-frases .form-paginar {
	float: right;
	margin-bottom: 10px;
}

.vr-frases .form-paginar select {
	height: 30px;
	margin: 0 5px;
}

/* Pagination adjustments - specific to VR-Frases - Removed duplicate rules */

/* Fix for pagination form - ensure visibility */
.vr-frases .tablenav-pages form {
	display: inline-block;
}

/* Vertical spacing between sections */
#vr-search-container + #vr-author-details,
#vr-author-details + #vr-quotes-list {
	margin-top: 25px;
	vertical-align: middle;
}

/* System messages */
div#message {
	font-weight: bold;
	margin-bottom: 15px;
	padding: 10px;
	width: 100%;
}

/* Global rule to prevent horizontal overflow */
.wrap * {
	max-width: 100%;
}

/* Specific positioning fixes */

/* Prevent overlapping */
.search-box {
	display: inline-block;
	margin-top: 25px;
	position: static;
	vertical-align: middle;
}

/* Space between edit buttons */
.row-actions .edit {
	margin-right: 5px;
}

/* Buttons in action columns - simplified */
.vr-frases .column-editar .button,
.vr-frases .column-borrar .button {
	display: inline-block;
}

/* Separation between edit and quick edit buttons */
.vr-frases .column-editar .button-group .button:first-child {
	margin-right: 5px;
}

/* Vertical alignment of Dashicons in buttons */
.vr-frases .column-editar .button .dashicons,
.vr-frases .column-borrar .button .dashicons {
	padding-top: 3px;
}

/* Barra de controles con Flexbox para admin de frases */
.vr-frases .vr-flexbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
	margin-bottom: 18px;
	width: 100%;
}

.vr-flexbar-search {
	flex: 1 1 220px;
	min-width: 180px;
	width: 72%;
}

.vr-flexbar-info {
	align-items: center;
	display: flex;
	flex: 0 1 auto;
	gap: 20px;
	justify-content: space-between;
	min-width: 280px;
}

.vr-flexbar-count {
	color: #00f;
	font-weight: bold;
	white-space: nowrap;
}

.vr-flexbar-paging {
	flex-shrink: 0;
}

@media (width <=700px) {
	.vr-flexbar {
	align-items: stretch;
	flex-direction: column;
	gap: 10px;
	}

	.vr-flexbar-info {
	align-items: stretch;
	flex-direction: column;
	gap: 10px;
	}

	.vr-flexbar-count {
	text-align: center;
	}
}

/* =====================
	1. Tablas y estructura
	===================== */

.wp-list-table.vr-frases th {
	vertical-align: middle;
}

.wp-list-table th,
.wp-list-table tfoot th {
	font-weight: bold;
}

/* Centrar horizontalmente las columnas */
.wp-list-table th.vr-column-center,
.wp-list-table td.vr-column-center {
	text-align: center !important;
}

.wp-list-table.vr-clases tr,
.wp-list-table.vr-temas tr {
	vertical-align: middle;
}

.wp-list-table th.check-column,
.wp-list-table tfoot th.check-column {
	padding-bottom: 7px !important;
	padding-top: 7px !important;
	text-align: center !important;
	vertical-align: middle !important;
}

.wp-list-table th.check-column input[type="checkbox"] {
	display: block;
	margin: 0 auto !important;
}

.vr-accordion {
	border: 1px solid #ccc;
	border-radius: 8px;
	margin-bottom: 7px;
	overflow: hidden;
}

.vr-accordion-toggle {
	background-color: #f5f5f5;
	border: none;
	cursor: pointer;
	font-weight: bold;
	padding: 6px 12px;
	text-align: left;
	width: 100%;
}

.vr-accordion-toggle h4 {
	align-items: center;
	color: #00a;
	display: flex;
}

.vr-accordion-toggle:hover {
	background-color: #e0e0e0;
}

.vr-accordion-content {
	background-color: #fff;
	border-top: 1px solid #ccc;
	display: none;
	padding: 6px 12px;
}

.vr-accordion-toggle .dashicons {
	color: #00a;
	vertical-align: middle;
}

.vr-frase-item {
	color: #00a;
	line-height: 1.4;
	margin-bottom: 6px;
	padding-left: 1.5em;
	position: relative;
}

.vr-frase-item::before {
	color: #00a;
	content: "»";
	font-size: 1.4em;
	left: 0;
	line-height: 1;
	position: absolute;
	top: -0.1em;
}

div .notice-info {
	background-color: #fff8c4;
	color: #b30000;
	font-size: 1.1em;
	margin-top: 10px;
}

h1 .dashicons {
	color: #00a;
	font-size: 32px;
	height: 32px;
	margin-right: 8px;
	vertical-align: middle;
	width: 32px;
}

h4 .dashicons {
	color: #00a;
	font-size: 24px;
	height: 24px;
	margin-right: 8px;
	vertical-align: middle;
	width: 24px;
}

.vr-frases .button-group .button,
.vr-frases .vr-delete-button {
	align-items: center;
	display: inline-flex;
	font-size: 16px;
	height: 36px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	width: 36px;
}

.vr-frases .button-group .dashicons,
.vr-frases .vr-delete-button .dashicons {
	font-size: 22px;
	height: 22px;
	width: 22px;
}

/* Color específico para icono de papelera en botones de borrar */
.vr-frases .vr-delete-button .dashicons-trash {
	color: #a00;
}

/* GDPR toggle button styling for consistency */
#vr-gdpr-toggle {
	transition: all 0.2s ease;
}

#vr-gdpr-toggle:hover {
	transform: none;

	/* Prevent default hover effects */
}

#vr-gdpr-toggle .dashicons {
	transition: transform 0.2s ease;
}

/**
 * SECTION: SYSTEM INFO TAB STYLING
 * Comprehensive styling for the System Information tab including
 * responsive grid layouts, statistics cards, and top lists display.
 */
.system-info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.system-info-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.system-info-card h3 {
	margin: 0 0 15px 0;
	color: #23282d;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 5px;
}

.system-info-table {
	width: 100%;
	border-collapse: collapse;
}

.system-info-table td {
	padding: 8px 12px;
	border-bottom: 1px solid #f1f1f1;
}

.system-info-table td:first-child {
	font-weight: 600;
	color: #555;
	width: 40%;
}

.system-info-table td:last-child {
	color: #0073aa;
	font-weight: 500;
}

.authors-list {
	max-height: 200px;
	overflow-y: auto;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 10px;
	margin-top: 10px;
}

.author-item {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	border-bottom: 1px solid #e0e0e0;
}

.author-item:last-child {
	border-bottom: none;
}

.quick-links {
	margin-top: 15px;
}

.quick-links a {
	display: inline-block;
	background: #0073aa;
	color: white;
	padding: 8px 12px;
	text-decoration: none;
	border-radius: 3px;
	margin-right: 10px;
	margin-bottom: 5px;
	font-size: 13px;
}

.quick-links a:hover {
	background: #005a87;
}
