/* =========================================================================
   CONSOFT IRA – Frontend Widget Styles
   ========================================================================= */

.ira-widget {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: #333;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

/* ---- Tab Navigation ---- */
.ira-tabs {
	display: flex;
	border-bottom: 2px solid #e0e0e0;
	background: #fafafa;
}

.ira-tab-btn {
	flex: 1;
	padding: 12px 16px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #666;
	transition: color 0.15s, border-color 0.15s;
}

.ira-tab-btn:hover {
	color: #333;
}

.ira-tab-btn.active {
	color: #7f54b3;
	border-bottom-color: #7f54b3;
}

/* Underline is the default — no extra class needed */
.ira-tabs--underline .ira-tab-btn.active {
	border-bottom-color: #7f54b3;
}

/* ---- Pills Tab Style ---- */
.ira-tabs--pills {
	border-bottom: none;
	background: transparent;
	padding: 10px 20px;
	gap: 6px;
	flex-wrap: wrap;
}

.ira-tabs--pills .ira-tab-btn {
	border: 2px solid #e0e0e0;
	border-radius: 20px;
	border-bottom: 2px solid #e0e0e0; /* override underline default */
	flex: none;
	margin-bottom: 0;
}

.ira-tabs--pills .ira-tab-btn.active {
	background: #7f54b3;
	border-color: #7f54b3;
	color: #fff;
}

.ira-tabs--pills .ira-tab-btn:hover:not(.active) {
	border-color: #7f54b3;
	color: #7f54b3;
}

/* ---- Boxed Tab Style ---- */
.ira-tabs--boxed {
	border-bottom: 2px solid #e0e0e0;
	gap: 0;
	padding: 0 20px;
}

.ira-tabs--boxed .ira-tab-btn {
	border: 1px solid #e0e0e0;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	margin-right: 2px;
	margin-bottom: -2px; /* sit on the border-bottom line */
	flex: none;
	background: #f5f5f5;
}

.ira-tabs--boxed .ira-tab-btn.active {
	background: #7f54b3;
	border-color: #7f54b3;
	color: #fff;
	border-bottom-color: #7f54b3; /* covers the border-bottom line */
}

.ira-tabs--boxed .ira-tab-btn:hover:not(.active) {
	background: #fff;
	color: #333;
}

/* ---- Tab Panels ---- */
.ira-tab-panel {
	display: none;
	padding: 20px;
}

.ira-tab-panel.active {
	display: block;
}

/* ---- Notice ---- */
.ira-notice {
	padding: 12px 16px;
	border-radius: 4px;
	margin: 16px;
}

.ira-notice--warning {
	background: #fff3cd;
	border: 1px solid #ffc107;
	color: #856404;
}

/* ---- Submit Form Toggle ---- */
.ira-submit-toggle {
	margin-bottom: 16px;
}

.ira-btn-primary {
	display: inline-block;
	padding: 9px 18px;
	background: #7f54b3;
	color: #fff;
	border: 2px solid #7f54b3;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
	line-height: 1;
}

.ira-btn-primary:hover {
	background: #6a45a0;
	border-color: #6a45a0;
	color: #fff;
}

.ira-btn-secondary {
	display: inline-block;
	padding: 9px 18px;
	background: transparent;
	color: #555;
	border: 2px solid #ccc;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: border-color 0.15s, color 0.15s;
	line-height: 1;
}

.ira-btn-secondary:hover {
	border-color: #888;
	color: #333;
}

/* ---- Submit Form ---- */
.ira-submit-form {
	background: #f9f9fb;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 18px;
	margin-bottom: 20px;
}

.ira-form-group {
	margin-bottom: 14px;
}

.ira-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #444;
}

.ira-required {
	color: #d63638;
}

.ira-help {
	font-weight: 400;
	font-size: 12px;
	color: #777;
	margin-left: 4px;
}

.ira-input,
.ira-textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.ira-input:focus,
.ira-textarea:focus {
	outline: none;
	border-color: #7f54b3;
	box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.15);
}

.ira-textarea {
	resize: vertical;
	min-height: 90px;
}

.ira-file {
	display: block;
	font-size: 13px;
}

.ira-form-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 4px;
}

.ira-form-message {
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 13px;
	margin-top: 10px;
}

.ira-form-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.ira-form-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ---- Status Filters ---- */
.ira-status-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

.ira-status-filter-btn {
	padding: 5px 12px;
	background: transparent;
	border: 1.5px solid #ccc;
	border-radius: 20px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s;
	color: #555;
}

.ira-status-filter-btn:hover {
	border-color: #7f54b3;
	color: #7f54b3;
}

.ira-status-filter-btn.active {
	background: #7f54b3;
	border-color: #7f54b3;
	color: #fff;
}

/* ---- Ideas List ---- */
.ira-ideas-list,
.ira-announcements-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ---- Idea Card ---- */
.ira-idea-card {
	display: flex;
	gap: 14px;
	padding: 14px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	transition: box-shadow 0.15s;
}

.ira-idea-card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Upvote */
.ira-upvote {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	padding: 6px 10px;
	border: 1.5px solid #ccc;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	transition: all 0.15s;
	gap: 2px;
	flex-shrink: 0;
}

.ira-upvote:hover {
	border-color: #7f54b3;
	color: #7f54b3;
}

.ira-upvote.voted {
	background: #7f54b3;
	border-color: #7f54b3;
	color: #fff;
}

.ira-upvote-icon {
	font-size: 16px;
	line-height: 1;
}

.ira-upvote-count {
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

/* Idea content */
.ira-idea-content {
	flex: 1;
	min-width: 0;
}

.ira-idea-title {
	font-size: 15px;
	font-weight: 600;
	color: #222;
	margin: 0 0 6px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	flex-wrap: wrap;
}

.ira-idea-description {
	font-size: 13px;
	color: #555;
	margin: 0 0 8px;
}

.ira-idea-meta {
	font-size: 12px;
	color: #888;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.ira-idea-attachment {
	font-size: 12px;
	margin-top: 6px;
}

.ira-idea-attachment a {
	color: #7f54b3;
	text-decoration: none;
}

.ira-idea-attachment a:hover {
	text-decoration: underline;
}

/* ---- Status Badge ---- */
.ira-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.ira-status-badge--blue   { background: #dbeafe; color: #1d4ed8; }
.ira-status-badge--yellow { background: #fef3c7; color: #92400e; }
.ira-status-badge--orange { background: #ffedd5; color: #9a3412; }
.ira-status-badge--purple { background: #ede9fe; color: #6d28d9; }
.ira-status-badge--green  { background: #d1fae5; color: #065f46; }

/* ---- Loading / Empty ---- */
.ira-loading {
	text-align: center;
	color: #999;
	padding: 24px;
	font-size: 14px;
}

.ira-empty {
	text-align: center;
	color: #999;
	padding: 32px 20px;
	font-size: 14px;
}

/* ---- Pagination ---- */
.ira-pagination {
	text-align: center;
	margin-top: 16px;
}

/* ---- Login Prompt ---- */
.ira-login-prompt {
	margin-bottom: 16px;
}

/* ---- Roadmap Columns ---- */
.ira-roadmap-columns {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}

.ira-roadmap-column {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
}

.ira-roadmap-column-header {
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ira-roadmap-column-header .ira-roadmap-count {
	margin-left: auto;
	background: rgba(0,0,0,0.12);
	border-radius: 10px;
	padding: 1px 7px;
	font-size: 12px;
}

/* Column header colors */
.ira-roadmap-column-header.ira-status-color--blue   { background: #dbeafe; color: #1d4ed8; }
.ira-roadmap-column-header.ira-status-color--yellow { background: #fef3c7; color: #92400e; }
.ira-roadmap-column-header.ira-status-color--orange { background: #ffedd5; color: #9a3412; }
.ira-roadmap-column-header.ira-status-color--purple { background: #ede9fe; color: #6d28d9; }
.ira-roadmap-column-header.ira-status-color--green  { background: #d1fae5; color: #065f46; }

.ira-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.ira-roadmap-items {
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 80px;
}

.ira-roadmap-item {
	padding: 10px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 5px;
	font-size: 13px;
}

.ira-roadmap-item-title {
	font-weight: 600;
	color: #222;
	margin-bottom: 4px;
}

.ira-roadmap-item-votes {
	font-size: 12px;
	color: #888;
}

/* ---- Announcement Card ---- */
.ira-announcement-card {
	padding: 16px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
}

.ira-announcement-title {
	font-size: 15px;
	font-weight: 700;
	color: #222;
	margin: 0 0 8px;
}

.ira-announcement-content {
	font-size: 14px;
	color: #444;
	margin: 0 0 10px;
}

.ira-announcement-meta {
	font-size: 12px;
	color: #888;
}

/* ---- Editor Placeholder ---- */
.ira-editor-placeholder {
	padding: 32px 20px;
	text-align: center;
	color: #888;
	border: 2px dashed #e0e0e0;
	border-radius: 6px;
}

.ira-editor-placeholder .dashicons {
	font-size: 36px;
	width: 36px;
	height: 36px;
	margin-bottom: 8px;
	color: #7f54b3;
}

/* ---- Spinner ---- */
.ira-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(0,0,0,0.1);
	border-top-color: #7f54b3;
	border-radius: 50%;
	animation: ira-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-left: 6px;
}

@keyframes ira-spin {
	to { transform: rotate(360deg); }
}

/* ---- Theme Inheritance Mode ---- */
/*
 * Add class "ira-widget--inherit" (via the Elementor widget's "Inherit Theme
 * Styles" toggle) to strip all of IRA's own container opinions, letting the
 * surrounding page / WooCommerce / theme styles take over.
 */
.ira-widget--inherit {
	background:    transparent !important;
	border:        none !important;
	border-radius: 0 !important;
	overflow:      visible !important;
	font-size:     inherit !important;
	color:         inherit !important;
	line-height:   inherit !important;
}

/* In inherit mode the tab bar should also shed its background */
.ira-widget--inherit .ira-tabs {
	background: transparent;
}

/* ---- Status header (ideas_by_status mode) ---- */
.ira-status-header {
	padding: 12px 20px 0;
}

/* ---- Direct content wrapper (non-tabbed modes) ---- */
.ira-widget-content {
	padding: 20px;
}

/* In inherit mode, remove the inner padding so the host layout controls spacing */
.ira-widget--inherit .ira-widget-content {
	padding: 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
	.ira-tab-btn {
		font-size: 13px;
		padding: 10px 10px;
	}

	.ira-roadmap-columns {
		grid-template-columns: 1fr 1fr;
	}

	.ira-idea-card {
		flex-direction: column;
	}

	.ira-upvote {
		flex-direction: row;
		width: auto;
		align-self: flex-start;
	}
}
