/* ==========================================
   Navire Design System
   Reusable UI Components
   ========================================== */

/* ==========================================
   Navigation
   ========================================== */

.app-nav {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 32px;
    z-index: 100;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-subtle);
}

.app-nav--transparent {
    background: rgba(0, 0, 0, 0.0);
    border-bottom: none;
    position: fixed;
}

.app-nav__left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.app-nav__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.app-nav__brand:hover {
    opacity: 0.8;
}

.app-nav__icon {
    fill: var(--icon-primary);
    width: 20px;
    height: 20px;
}

.app-nav__logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.app-nav__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Project Selector */
.project-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-s);
    transition: all 0.2s;
}

.project-selector:hover {
    background: var(--selection-bg);
    color: var(--text-primary);
}

.project-name {
    font-weight: 500;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
    box-sizing: border-box;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-s);
}

.btn-text:hover {
    color: var(--text-primary);
    background: var(--selection-bg);
}

.btn-primary {
    border-radius: 6px;
    padding: 8px 18px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 500;
    box-sizing: border-box;
    border: 1px solid transparent;
    gap: 8px;
    display: inline-flex;
    align-items: center;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
}

.btn-secondary {
    border-radius: 6px;
    padding: 8px 18px;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--border-subtle);
    font-weight: 600;
    gap: 8px;
    display: inline-flex;
    align-items: center;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
    border-color: var(--border-glow);
}

.btn-create {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-s);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-subtle);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-s);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon .icon {
    fill: var(--icon-secondary);
}

.btn-icon:hover {
    background: var(--selection-bg);
    border-color: var(--border-glow);
}

.btn-icon:hover .icon {
    fill: var(--icon-primary);
}

.btn-icon-ghost {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-s);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-icon-ghost:hover {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

/* Tooltip for icon buttons */
.btn-tooltip {
    position: relative;
}

.btn-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-s);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-tooltip:hover::after {
    opacity: 1;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 8px;
}

/* ==========================================
   Modals
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-m);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal--small {
    max-width: 450px;
}

.modal__header {
    padding: var(--space-l);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-l);
}

.modal__title-section {
    flex: 1;
}

.modal__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    font-family: var(--font-serif);
}

.modal__description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.modal__close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-s);
    transition: all 0.2s;
}

.modal__close:hover {
    background: var(--selection-bg);
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-l);
}

.modal__field {
    margin-bottom: var(--space-l);
}

.modal__field:last-child {
    margin-bottom: 0;
}

.modal__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-s);
    font-family: var(--font-sans);
}

.modal__input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-s);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 12px 16px;
    outline: none;
    transition: all 0.2s;
}

.modal__input::placeholder {
    color: var(--text-tertiary);
}

.modal__textarea {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-sans);
}

.modal__input:focus {
    border-color: var(--border-glow);
    background: var(--bg-panel);
}

.modal__button {
    width: 100%;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: var(--radius-s);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.modal__actions {
    display: flex;
    gap: var(--space-m);
    width: 100%;
}

.modal__button--secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.modal__button--secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-glow);
}

.modal__button--danger {
    background: #e05e5e;
    color: #ffffff;
}

.modal__button--danger:hover {
    background: #c84e4e;
    box-shadow: 0 4px 12px rgba(224, 94, 94, 0.3);
}

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

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-s);
    padding: var(--space-m);
    transition: all 0.2s;
}

.card--clickable {
    cursor: pointer;
}

.card--clickable:hover {
    background: var(--bg-hover);
    border-color: var(--border-glow);
}

.card--elevated {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-s);
}

.card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card__badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.card__description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================
   Dropdowns
   ========================================== */

.dropdown {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-s);
    padding: 4px;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: none;
}

.dropdown.show {
    display: block;
}

.project-dropdown {
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
}

.dropdown-item:hover {
    background: var(--selection-bg);
}

.dropdown-item svg {
    width: 14px;
    height: 14px;
    fill: var(--icon-secondary);
}

.dropdown-item:hover svg {
    fill: var(--icon-primary);
}

.dropdown-item.danger {
    color: #e05e5e;
}

.dropdown-item.danger svg {
    fill: #e05e5e !important;
}

.dropdown-item.danger:hover {
    background: rgba(224, 94, 94, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* ==========================================
   Empty States
   ========================================== */

.empty-state {
    padding: var(--space-xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-m);
}

.empty-state__icon {
    fill: var(--icon-tertiary);
    opacity: 0.5;
}

.empty-state__text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.empty-state__subtext {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0;
    max-width: 300px;
}

/* ==========================================
   Notifications
   ========================================== */

.notification {
    position: fixed;
    bottom: var(--space-l);
    right: var(--space-l);
    background: var(--bg-surface);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-s);
    padding: var(--space-m) var(--space-l);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 14px;
    z-index: 9999;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


@media (max-width: 768px) {

    .app-nav {

        padding: 8px 16px;
        
    }
}
