/**
 * Army System - Stylesheet
 *
 * Styles for the Army System SMF 2.1.x mod. Designed to work with the
 * default SMF theme and to gracefully degrade in custom themes.
 *
 * @package ArmySystem
 * @version 1.0
 */

/* ==========================================================================
   Menu & Admin Icons
   ========================================================================== */

.main_icons.army::before {
	background: url(../images/army/f_fortress.png) center / contain no-repeat;
	background-size: 16px;
}

.admin_img_army {
	background: url(../images/army/f_fortress.png) center / contain no-repeat;
}

/* ==========================================================================
   Layout: Sidebar + Content Wrapper
   ========================================================================== */

.army_wrapper {
	display: flex;
	gap: 20px;
	margin-bottom: 16px;
}

.army_sidebar {
	width: 200px;
	flex-shrink: 0;
}

.army_content {
	flex: 1;
	min-width: 0;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.army_nav_list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.army_nav_list li.army_nav_item {
	margin: 0;
	padding: 0;
}

.army_nav_list li a {
	display: block;
	padding: 8px 12px;
	border-bottom: 1px solid #ddd;
	color: #333;
	text-decoration: none;
	font-size: 0.9em;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.army_nav_list li a:hover {
	background: #f0f4f8;
	color: #222;
}

.army_nav_list li.army_nav_active a {
	background: #5c8aff;
	color: #fff !important;
	font-weight: bold;
	border-bottom-color: #4a7ae8;
}

.army_nav_list li:last-child a {
	border-bottom: none;
}

/* ==========================================================================
   Stats Grid (Dashboard, Profile, Attack preview)
   ========================================================================== */

.army_stats_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	padding: 8px 0;
}

.army_stats_section {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 12px 16px;
}

.army_stats_section h4,
.army_stat_card h4 {
	margin: 0 0 10px;
	font-size: 13px;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid #dee2e6;
	padding-bottom: 6px;
}

.army_stat_card {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 12px 16px;
}

/* Stats definition list */
.army_stats_list {
	margin: 0;
	padding: 0;
}

.army_stats_list dt {
	float: left;
	clear: left;
	width: 55%;
	font-weight: 600;
	padding: 4px 0;
	color: #555;
	font-size: 0.9em;
}

.army_stats_list dd {
	margin-left: 57%;
	padding: 4px 0;
	font-size: 0.9em;
}

.army_stats_list dt:after {
	content: "";
}

/* ==========================================================================
   Bonus Value Colors
   ========================================================================== */

.army_bonus_positive {
	color: #28a745;
	font-weight: bold;
}

.army_bonus_negative {
	color: #dc3545;
	font-weight: bold;
}

.army_bonus_neutral {
	color: #6c757d;
}

/* ==========================================================================
   Battle Result Styling
   ========================================================================== */

.army_result_victory {
	border-left: 4px solid #28a745;
}

.army_result_defeat {
	border-left: 4px solid #dc3545;
}

.army_battle_victory {
	border-left: 4px solid #28a745;
}

.army_battle_defeat {
	border-left: 4px solid #dc3545;
}

/* ==========================================================================
   Shop Tabs / Transfer Tabs / Filter Tabs
   ========================================================================== */

.army_shop_tabs,
.army_transfer_tabs,
.army_filter_tabs,
.army_admin_tabs,
.army_item_type_tabs,
.army_log_type_tabs {
	margin-bottom: 12px;
}

.army_shop_tabs ul,
.army_transfer_tabs ul,
.army_filter_tabs ul,
.army_admin_tabs ul,
.army_item_type_tabs ul,
.army_log_type_tabs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.army_shop_tabs li,
.army_transfer_tabs li,
.army_filter_tabs li,
.army_admin_tabs li,
.army_item_type_tabs li,
.army_log_type_tabs li {
	margin: 0;
}

.army_shop_tabs a,
.army_transfer_tabs a,
.army_filter_tabs a {
	padding: 6px 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 0.9em;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.army_shop_tabs a:hover,
.army_transfer_tabs a:hover,
.army_filter_tabs a:hover {
	background: #f0f4f8;
	border-color: #aaa;
}

.army_shop_tabs a.active,
.army_transfer_tabs a.active,
.army_filter_tabs a.active {
	background: #5c8aff;
	color: #fff;
	border-color: #5c8aff;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.army_table {
	width: 100%;
	border-collapse: collapse;
}

.army_table th {
	background: #f0f0f0;
	padding: 8px 10px;
	text-align: left;
	border-bottom: 2px solid #dee2e6;
	font-size: 0.9em;
	white-space: nowrap;
}

.army_table td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	font-size: 0.9em;
	vertical-align: middle;
}

.army_table tr:hover td {
	background: #f8f9fa;
}

.army_table th.centercol,
.army_table td.centercol {
	text-align: center;
}

/* Race comparison table - tighter columns */
.army_race_table th,
.army_race_table td {
	padding: 6px 8px;
	text-align: center;
}

.army_race_table td:first-child,
.army_race_table th:first-child {
	text-align: left;
}

/* Row highlighting for current level in progression tables */
.army_row_current {
	background: #e8f4fd !important;
}

.army_row_current td {
	background: #e8f4fd !important;
}

/* ==========================================================================
   Quick Action Buttons (Dashboard)
   ========================================================================== */

.army_quick_actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 0;
}

.army_quick_actions a {
	padding: 8px 16px;
	background: #5c8aff;
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.9em;
	transition: background-color 0.15s ease;
}

.army_quick_actions a:hover {
	background: #4a7ae8;
}

/* ==========================================================================
   Event Feed
   ========================================================================== */

.army_events_list {
	margin: 0;
	padding: 0;
}

.army_event_item {
	padding: 8px 12px;
	margin-bottom: 2px;
	border-left: 3px solid #dee2e6;
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.army_event_time {
	flex-shrink: 0;
	color: #888;
	min-width: 140px;
}

.army_event_text {
	flex: 1;
}

/* Event type-specific left borders */
.army_event_attack,
.army_event_type_1 {
	border-left-color: #dc3545;
}

.army_event_levelup,
.army_event_type_2 {
	border-left-color: #ffc107;
}

.army_event_revive,
.army_event_type_3 {
	border-left-color: #28a745;
}

.army_event_transfer,
.army_event_type_4 {
	border-left-color: #17a2b8;
}

.army_event_donation,
.army_event_type_6 {
	border-left-color: #6f42c1;
}

.army_event_default {
	border-left-color: #dee2e6;
}

/* ==========================================================================
   Form Elements Within Army Pages
   ========================================================================== */

.army_qty_input {
	width: 80px;
	text-align: center;
	padding: 4px 6px;
}

.army_inline_form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
}

.army_inline_form strong {
	min-width: 150px;
}

.army_inline_form .input_text {
	width: 80px;
}

.army_inline_form .button {
	margin-left: 4px;
}

/* Item icon styling */
.army_item_icon {
	max-width: 32px;
	max-height: 32px;
	vertical-align: middle;
	margin-right: 4px;
}

/* Race icon styling */
.army_race_icon {
	max-width: 32px;
	max-height: 32px;
	vertical-align: middle;
	margin-right: 4px;
}

/* Ship icon styling (larger for ship art) */
.army_ship_icon {
	max-width: 48px;
	max-height: 48px;
	vertical-align: middle;
	margin-right: 6px;
}

/* ==========================================================================
   Power Rating Bars
   ========================================================================== */

.army_power_bar_wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}

.army_power_bar {
	flex: 1;
	height: 18px;
	background: #e9ecef;
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}

.army_power_bar_fill {
	height: 100%;
	border-radius: 3px;
	transition: width 0.3s ease;
}

.army_power_bar_fill.attack {
	background: linear-gradient(90deg, #dc3545, #e74c5c);
}

.army_power_bar_fill.defense {
	background: linear-gradient(90deg, #28a745, #3dbe5c);
}

.army_power_bar_fill.spy {
	background: linear-gradient(90deg, #6f42c1, #8956d9);
}

.army_power_bar_fill.sentry {
	background: linear-gradient(90deg, #fd7e14, #f59340);
}

.army_power_bar_fill.naval {
	background: linear-gradient(90deg, #17a2b8, #3bbfd4);
}

.army_power_value {
	font-weight: bold;
	font-size: 0.9em;
	min-width: 70px;
	text-align: right;
}

/* ==========================================================================
   Spy Accuracy Indicator
   ========================================================================== */

.army_spy_accuracy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.army_accuracy_bar {
	width: 120px;
	height: 12px;
	background: #e9ecef;
	border-radius: 6px;
	overflow: hidden;
}

.army_accuracy_fill {
	height: 100%;
	border-radius: 6px;
	transition: width 0.3s ease;
}

.army_accuracy_fill.perfect {
	background: #28a745;
}

.army_accuracy_fill.high {
	background: #7bc67e;
}

.army_accuracy_fill.medium {
	background: #ffc107;
}

.army_accuracy_fill.low {
	background: #dc3545;
}

/* Spy mission type badge */
.army_spy_recon {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	background: #d4edda;
	color: #155724;
	font-size: 0.85em;
	font-weight: 600;
}

.army_spy_sabotage {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	background: #f8d7da;
	color: #721c24;
	font-size: 0.85em;
	font-weight: 600;
}

/* ==========================================================================
   Clan Member List
   ========================================================================== */

.army_clan_members_list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.army_clan_members_list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	border-bottom: 1px solid #eee;
}

.army_clan_members_list li:last-child {
	border-bottom: none;
}

.army_clan_members_list .army_clan_member_info {
	display: flex;
	align-items: center;
	gap: 8px;
}

.army_clan_members_list .army_clan_member_actions {
	display: flex;
	gap: 4px;
}

/* ==========================================================================
   Fort/Siege Progression Indicators
   ========================================================================== */

.army_progression_wrapper {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 0;
}

.army_progression_step {
	flex: 1;
	height: 8px;
	border-radius: 4px;
	background: #e9ecef;
	position: relative;
	min-width: 20px;
}

.army_progression_step.completed {
	background: #28a745;
}

.army_progression_step.current {
	background: #5c8aff;
	box-shadow: 0 0 0 2px #5c8aff33;
}

.army_progression_step.locked {
	background: #e9ecef;
}

.army_progression_label {
	font-size: 0.85em;
	color: #666;
	text-align: center;
	margin-top: 4px;
}

/* ==========================================================================
   Soldier/Merc Count Displays
   ========================================================================== */

.army_count_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}

.army_count_item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
}

.army_count_icon {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.army_count_icon img {
	max-width: 32px;
	max-height: 32px;
}

.army_count_info {
	display: flex;
	flex-direction: column;
}

.army_count_label {
	font-size: 0.8em;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.army_count_value {
	font-size: 1.2em;
	font-weight: bold;
	color: #333;
}

/* ==========================================================================
   Section Headers Within Pages
   ========================================================================== */

.army_section_header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 2px solid #dee2e6;
	margin-bottom: 12px;
}

.army_section_header h4 {
	margin: 0;
	font-size: 1em;
	color: #333;
}

.army_section_header .army_section_action {
	font-size: 0.85em;
}

/* ==========================================================================
   Reset / Leave Options
   ========================================================================== */

.army_reset_options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.army_reset_option {
	padding: 16px;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	background: #f8f9fa;
}

.army_reset_option h4 {
	margin: 0 0 8px;
	font-size: 1.1em;
}

.army_reset_option p {
	font-size: 0.9em;
	color: #555;
	margin-bottom: 12px;
}

/* ==========================================================================
   Admin Panel Specific Styles
   ========================================================================== */

#admincenter .army_admin_tabs {
	margin-bottom: 16px;
	padding: 0;
}

#admincenter .army_admin_tabs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

#admincenter .army_admin_tabs a.button.active {
	background: #5c8aff;
	color: #fff;
	border-color: #5c8aff;
}

/* Admin item type tabs */
#admincenter .army_item_type_tabs ul,
#admincenter .army_log_type_tabs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

#admincenter .army_item_type_tabs a.button.active,
#admincenter .army_log_type_tabs a.button.active {
	background: #5c8aff;
	color: #fff;
	border-color: #5c8aff;
}

/* Admin inline edit toggle rows */
#admincenter .roundframe {
	margin: 8px 0;
}

/* Admin member search */
#admincenter .army_admin_member_form .settings dt {
	width: 30%;
}

#admincenter .army_admin_member_form .settings dd {
	width: 65%;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
	.army_wrapper {
		flex-direction: column;
	}

	.army_sidebar {
		width: 100%;
	}

	.army_nav_list {
		display: flex;
		flex-wrap: wrap;
		gap: 2px;
	}

	.army_nav_list li a {
		padding: 6px 10px;
		border-bottom: none;
		border: 1px solid #ddd;
		border-radius: 3px;
		font-size: 0.85em;
	}

	.army_nav_list li.army_nav_active a {
		border-color: #5c8aff;
	}

	.army_stats_grid {
		grid-template-columns: 1fr;
	}

	.army_stats_list dt {
		float: none;
		width: 100%;
		padding-bottom: 0;
	}

	.army_stats_list dd {
		margin-left: 0;
		padding-top: 2px;
		padding-bottom: 8px;
		border-bottom: 1px solid #f0f0f0;
	}

	.army_inline_form {
		flex-direction: column;
		align-items: flex-start;
	}

	.army_inline_form strong {
		min-width: auto;
	}

	.army_shop_tabs ul,
	.army_transfer_tabs ul,
	.army_filter_tabs ul {
		flex-wrap: wrap;
	}

	.army_reset_options {
		grid-template-columns: 1fr;
	}

	.army_event_item {
		flex-direction: column;
		gap: 4px;
	}

	.army_event_time {
		min-width: auto;
	}

	.army_count_grid {
		grid-template-columns: 1fr 1fr;
	}

	/* Make admin tables scrollable on mobile */
	#admincenter .table_grid {
		display: block;
		overflow-x: auto;
	}
}

@media (max-width: 480px) {
	.army_count_grid {
		grid-template-columns: 1fr;
	}

	.army_qty_input {
		width: 60px;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.army_sidebar,
	.army_quick_actions,
	.army_shop_tabs,
	.army_transfer_tabs,
	.army_filter_tabs,
	.army_admin_tabs,
	.army_item_type_tabs,
	.army_log_type_tabs,
	.buttonlist,
	.pagesection {
		display: none !important;
	}

	.army_wrapper {
		display: block;
	}

	.army_content {
		width: 100%;
	}
}
