/**
 * Enhanced Component Library - ProductPardesLine
 * Professional SaaS components built on design tokens
 */

/* === BUTTONS === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: var(--btn-height);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-family: var(--font-primary);
    font-size: var(--btn-font-size);
    font-weight: var(--btn-font-weight);
    border-radius: var(--btn-radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--color-00);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: var(--secondary-variant);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-secondary);
}

.btn-outline {
    background: transparent;
    color: var(--text-high);
    border: var(--border-width-thick) solid var(--primary);
}

.btn-outline:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary-variant);
}

.btn-ghost {
    background: transparent;
    color: var(--text-medium);
}

.btn-ghost:hover {
    background: var(--color-03);
    color: var(--text-high);
}

.btn-sm {
    height: 36px;
    padding: 8px 16px;
    font-size: var(--text-small);
}

.btn-lg {
    height: 52px;
    padding: 16px 32px;
    font-size: var(--text-h5);
}

.btn-icon {
    width: var(--btn-height);
    padding: 0;
    border-radius: var(--radius-md);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === CARDS === */

.card {
    background: var(--card-bg);
    border: var(--border-width) solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.card-glass {
    background: var(--glass-bg);
    border: var(--border-width) solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card-highlight {
    border-left: 4px solid var(--primary);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: var(--border-width) solid var(--border-color);
}

.card-title {
    font-size: var(--text-h3);
    font-weight: var(--weight-semibold);
    color: var(--text-high);
    margin: 0;
}

.card-subtitle {
    font-size: var(--text-small);
    color: var(--text-medium);
    margin-top: var(--space-xs);
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: var(--border-width) solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* === INPUTS === */

.input-group {
    position: relative;
    margin-bottom: var(--space-md);
}

.input-label {
    display: block;
    font-size: var(--text-small);
    font-weight: var(--weight-medium);
    color: var(--text-medium);
    margin-bottom: var(--space-xs);
}

.input {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--input-padding-x);
    background: var(--input-bg);
    border: var(--border-width) solid var(--input-border);
    border-radius: var(--input-radius);
    font-family: var(--font-primary);
    font-size: var(--text-body);
    color: var(--text-high);
    transition: all var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.input::placeholder {
    color: var(--text-disable);
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-medium);
    pointer-events: none;
}

.input-with-icon {
    padding-left: calc(var(--space-xl) + var(--space-md));
}

/* === MODALS === */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    animation: fadeIn var(--transition-base) forwards;
}

.modal {
    background: var(--modal-bg);
    border-radius: var(--modal-radius);
    padding: var(--modal-padding);
    box-shadow: var(--shadow-2xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    transform: scale(0.9);
    animation: modalSlideUp var(--transition-base) var(--ease-out) forwards;
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--color-03);
    border: none;
    color: var(--text-medium);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-close:hover {
    background: var(--color-04);
    color: var(--text-high);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: var(--space-2xl);
}

.modal-title {
    font-size: var(--text-h2);
    font-weight: var(--weight-bold);
    color: var(--text-high);
    margin: 0;
}

.modal-subtitle {
    font-size: var(--text-body);
    color: var(--text-medium);
    margin-top: var(--space-sm);
}

/* === BADGES === */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-tiny);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(var(--secondary-rgb), 0.2);
    color: var(--secondary);
}

.badge-success {
    background: rgba(57, 181, 74, 0.2);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 67, 67, 0.2);
    color: var(--error);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.badge-info {
    background: rgba(33, 150, 243, 0.2);
    color: var(--info);
}

/* === TOOLTIPS === */

.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + var(--space-sm));
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-00);
    color: var(--text-high);
    font-size: var(--text-tiny);
    white-space: nowrap;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip:hover::before {
    opacity: 1;
}

/* === BREADCRUMBS === */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    font-size: var(--text-small);
    color: var(--text-medium);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.breadcrumb-link {
    color: var(--text-medium);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-disable);
}

.breadcrumb-current {
    color: var(--text-high);
    font-weight: var(--weight-medium);
}

/* === ANIMATIONS === */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-02) 0%,
        var(--color-03) 50%,
        var(--color-02) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* === SCROLLBAR STYLING === */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: var(--radius-sm);
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--color-05);
    background-clip: content-box;
}

/* === UTILITY CLASSES === */

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Spacing */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.m-0 { margin: 0; }
.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-high { color: var(--text-high); }
.text-medium { color: var(--text-medium); }
.text-disable { color: var(--text-disable); }
.font-bold { font-weight: var(--weight-bold); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-medium { font-weight: var(--weight-medium); }
.font-normal { font-weight: var(--weight-regular); }
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Select */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-screen { width: 100vw; }
.h-screen { height: 100vh; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* Borders */
.border { border: var(--border-width) solid var(--border-color); }
.border-t { border-top: var(--border-width) solid var(--border-color); }
.border-b { border-bottom: var(--border-width) solid var(--border-color); }
.border-l { border-left: var(--border-width) solid var(--border-color); }
.border-r { border-right: var(--border-width) solid var(--border-color); }
.border-none { border: none; }

/* Rounded */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
