/**
 * Abhirang Store - UI Components
 * Buttons, Cards, Forms, Badges, Alerts, Empty States
 */

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-primary:hover {
    background: #374151;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: #ffffff;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: #6b7280;
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* Danger Button */
.btn-danger {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =============================================================================
   Cards
   ============================================================================= */

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.card-body {
    padding: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Hoverable Card */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   Form Elements
   ============================================================================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-label .required {
    color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Input with icon */
.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.2s ease;
}

.input-wrapper .form-input {
    padding-left: 44px;
}

.input-wrapper .form-input:focus ~ .input-icon {
    color: #1a1a1a;
}

/* Help Text & Error Message */
.form-help {
    font-size: 13px;
    color: #6b7280;
}

.form-error {
    font-size: 13px;
    color: #ef4444;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.15s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: "✓";
    display: block;
    text-align: center;
    color: #ffffff;
    font-size: 12px;
    line-height: 16px;
}

.checkbox-wrapper label {
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

/* =============================================================================
   Badges
   ============================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #ecfdf5;
    color: #065f46;
}

.badge-warning {
    background: #fffbeb;
    color: #92400e;
}

.badge-error {
    background: #fef2f2;
    color: #991b1b;
}

.badge-info {
    background: #eff6ff;
    color: #1e40af;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

.badge-dark {
    background: #1a1a1a;
    color: #ffffff;
}

/* Small Badge */
.badge-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* =============================================================================
   Alerts
   ============================================================================= */

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    margin-bottom: 4px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* =============================================================================
   Empty State
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: #4b5563;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
    color: #6b7280;
}

/* =============================================================================
   Info Grid (Profile-like layouts)
   ============================================================================= */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.info-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.info-value.muted {
    color: #6b7280;
    font-weight: 400;
    font-style: italic;
}

/* =============================================================================
   Divider
   ============================================================================= */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}

/* =============================================================================
   Quick Actions Grid
   ============================================================================= */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    text-decoration: none;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #4b5563;
}

.quick-action-text h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.quick-action-text span {
    font-size: 12px;
    color: #6b7280;
}

/* =============================================================================
   Breadcrumbs
   ============================================================================= */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #1a1a1a;
}

.breadcrumbs .separator {
    color: #9ca3af;
}

.breadcrumbs .current {
    color: #1a1a1a;
    font-weight: 500;
}

/* =============================================================================
   Pagination
   ============================================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1a1a1a;
}

.pagination .active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

/* Display */
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-none { display: none; }

/* Flexbox */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Margins */
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* Text */
.text-link {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.text-link:hover {
    text-decoration: underline;
}

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* Inline Button (looks like link) */
.btn-inline {
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-inline:hover {
    opacity: 0.8;
}

/* Password Requirements Box */
.password-requirements {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 8px;
}

.password-requirements h4 {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
    font-weight: 600;
}

.password-requirements ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #6b7280;
    font-size: 13px;
}

.password-requirements li {
    margin-bottom: 4px;
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

/* Display */
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-none { display: none; }

/* Flexbox */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Margins */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.ml-8 { margin-left: 8px; }
.mr-8 { margin-right: 8px; }

/* Text Utilities */
.text-muted { color: #6b7280; }
.text-danger { color: #dc2626; }
.text-success { color: #059669; }
.text-center { text-align: center; }
.font-weight-normal { font-weight: 400; }
.font-weight-bold { font-weight: 600; }

/* Links */
.text-link {
    color: #4f46e5;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #4f46e5;
    cursor: pointer;
    font-size: inherit;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link-inline {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    color: #dc2626;
    cursor: pointer;
    font-size: inherit;
}

.btn-link-inline:hover {
    text-decoration: underline;
}

/* Danger Outline Button */
.btn-danger-outline {
    background: #fff;
    color: #dc2626;
    border: 1px solid #dc2626;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

/* Image Placeholders */
.item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.item-image-placeholder i {
    color: #9ca3af;
    font-size: 24px;
}

/* Stock Error List */
.stock-error-list {
    margin: 8px 0 0 16px;
}

/* Icon Sizes */
.icon-xlarge {
    font-size: 5rem;
}

