/**
 * LCARS Widgets Styles
 * Futuristic Star Trek inspired design system
 */

/* =========================================
   LCARS Button Widget
   ========================================= */
.lcars-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    border: none;
    outline: none;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--lcars-font-primary, 'Antonio', sans-serif);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lcars-button__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.75em 2em;
    position: relative;
    z-index: 2;
}

.lcars-button__text {
    display: inline-block;
}

.lcars-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.lcars-button__icon--before {
    margin-right: 0.25em;
}

.lcars-button__icon--after {
    margin-left: 0.25em;
}

/* Button Styles */
.lcars-button--sweep-left {
    border-radius: 50px 0 0 50px;
    background: linear-gradient(90deg, var(--button-color, #FF9900) 0%, var(--button-color, #FF9900) 95%, transparent 100%);
}

.lcars-button--sweep-right {
    border-radius: 0 50px 50px 0;
    background: linear-gradient(270deg, var(--button-color, #FF9900) 0%, var(--button-color, #FF9900) 95%, transparent 100%);
}

.lcars-button--rounded {
    border-radius: 30px;
    background: var(--button-color, #FF9900);
}

.lcars-button--rectangular {
    border-radius: 0;
    background: var(--button-color, #FF9900);
    position: relative;
}

.lcars-button--rectangular::before,
.lcars-button--rectangular::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 100%;
    background: currentColor;
    opacity: 0.5;
}

.lcars-button--rectangular::before {
    left: -10px;
}

.lcars-button--rectangular::after {
    right: -10px;
}

.lcars-button--pill {
    border-radius: 50px;
    background: var(--button-color, #FF9900);
}

/* Color Schemes */
.lcars-button--orange {
    --button-color: #FF9900;
    color: #000000;
}

.lcars-button--purple {
    --button-color: #CC99CC;
    color: #000000;
}

.lcars-button--blue {
    --button-color: #9999CC;
    color: #000000;
}

.lcars-button--red {
    --button-color: #CC6666;
    color: #FFFFFF;
}

.lcars-button--yellow {
    --button-color: #FFCC00;
    color: #000000;
}

.lcars-button--green {
    --button-color: #99CC99;
    color: #000000;
}

.lcars-button--pink {
    --button-color: #FF9999;
    color: #000000;
}

/* Sizes */
.lcars-button--size-sm .lcars-button__content {
    padding: 0.5em 1.5em;
    font-size: 0.875rem;
}

.lcars-button--size-md .lcars-button__content {
    padding: 0.75em 2em;
    font-size: 1rem;
}

.lcars-button--size-lg .lcars-button__content {
    padding: 1em 2.5em;
    font-size: 1.125rem;
}

.lcars-button--size-xl .lcars-button__content {
    padding: 1.25em 3em;
    font-size: 1.25rem;
}

/* Full Width */
.lcars-button--full {
    width: 100%;
}

/* Hover Animations */
.lcars-button--glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--button-color, #FF9900),
                0 0 60px var(--button-color, #FF9900),
                0 10px 20px rgba(0, 0, 0, 0.3);
}

.lcars-button--pulse {
    animation: lcars-pulse 2s ease-in-out infinite;
}

@keyframes lcars-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Scan Line Effect */
.lcars-button--scan::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 45%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.1) 55%, 
        transparent 100%);
    transition: top 0.5s ease;
    z-index: 3;
}

.lcars-button--scan:hover::before {
    top: 100%;
}

/* Energize Effect */
.lcars-button--energize {
    position: relative;
}

.lcars-button--energize::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    z-index: 1;
}

.lcars-button--energize:hover::after {
    width: 200%;
    height: 200%;
}

/* Warp Effect */
.lcars-button--warp:hover .lcars-button__content {
    animation: lcars-warp 0.5s ease;
}

@keyframes lcars-warp {
    0% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(1.5);
    }
    100% {
        transform: scaleX(1);
    }
}

/* Particle Effect */
.lcars-button__particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.lcars-button[data-particles="true"]:hover .lcars-button__particles::before,
.lcars-button[data-particles="true"]:hover .lcars-button__particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--button-color, #FF9900);
    border-radius: 50%;
    animation: particle-float 3s ease-in-out infinite;
}

.lcars-button[data-particles="true"]:hover .lcars-button__particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.lcars-button[data-particles="true"]:hover .lcars-button__particles::after {
    top: 80%;
    right: 20%;
    animation-delay: 1.5s;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(30px, -30px) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translate(50px, -50px) scale(0);
        opacity: 0;
    }
}

/* Red Alert Animation */
.lcars-button[data-function="red_alert"] {
    animation: red-alert-flash 1s ease-in-out infinite;
}

@keyframes red-alert-flash {
    0%, 100% {
        background-color: #CC6666;
        box-shadow: 0 0 0 rgba(204, 102, 102, 0);
    }
    50% {
        background-color: #FF6666;
        box-shadow: 0 0 30px rgba(255, 102, 102, 0.8);
    }
}

/* =========================================
   LCARS Card Widget
   ========================================= */
.lcars-card-widget {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #333333;
    border-radius: 0 30px 0 30px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lcars-card-widget::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: var(--lcars-orange);
    border-radius: 0 0 0 100%;
    transition: all 0.3s ease;
}

.lcars-card-widget::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 5px;
    background: var(--lcars-blue);
    transition: all 0.3s ease;
}

.lcars-card-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 153, 0, 0.2);
    border-color: var(--lcars-orange);
}

.lcars-card-widget:hover::before {
    width: 80px;
    height: 80px;
}

.lcars-card-widget:hover::after {
    width: 100%;
    background: linear-gradient(90deg, var(--lcars-blue) 0%, var(--lcars-orange) 100%);
}

.lcars-card__header {
    margin-bottom: 1.5rem;
    position: relative;
}

.lcars-card__title {
    font-family: var(--lcars-font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lcars-orange);
    margin: 0;
}

.lcars-card__subtitle {
    font-size: 0.875rem;
    color: var(--lcars-blue);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lcars-card__content {
    color: #CCCCCC;
    line-height: 1.6;
}

.lcars-card__footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lcars-card__badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--lcars-purple);
    color: #000000;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   LCARS Navigation Widget
   ========================================= */
.lcars-navigation {
    display: flex;
    align-items: stretch;
    background: #000000;
    border-radius: 30px 0 0 30px;
    overflow: hidden;
    position: relative;
}

.lcars-navigation--vertical {
    flex-direction: column;
    border-radius: 30px 30px 0 0;
}

.lcars-navigation__bar {
    width: 10px;
    background: var(--lcars-orange);
    position: relative;
}

.lcars-navigation--vertical .lcars-navigation__bar {
    width: 100%;
    height: 10px;
}

.lcars-navigation__bar::before,
.lcars-navigation__bar::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--lcars-orange);
}

.lcars-navigation__bar::before {
    top: 0;
    left: 0;
    border-radius: 0 0 30px 0;
}

.lcars-navigation__bar::after {
    bottom: 0;
    left: 0;
    border-radius: 0 30px 0 0;
}

.lcars-navigation__menu {
    display: flex;
    flex-grow: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #1a1a1a;
}

.lcars-navigation--vertical .lcars-navigation__menu {
    flex-direction: column;
}

.lcars-navigation__item {
    position: relative;
}

.lcars-navigation__link {
    display: block;
    padding: 1rem 2rem;
    color: #CCCCCC;
    text-decoration: none;
    font-family: var(--lcars-font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lcars-navigation__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--lcars-orange) 50%, transparent 100%);
    opacity: 0.3;
    transition: left 0.3s ease;
}

.lcars-navigation__link:hover {
    color: var(--lcars-orange);
    background: rgba(255, 153, 0, 0.1);
}

.lcars-navigation__link:hover::before {
    left: 100%;
}

.lcars-navigation__link--active {
    color: var(--lcars-orange);
    background: rgba(255, 153, 0, 0.2);
}

/* =========================================
   LCARS Panel Widget
   ========================================= */
.lcars-panel-widget {
    background: #0a0a0a;
    border-left: 5px solid var(--lcars-orange);
    border-radius: 30px 0 0 30px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.lcars-panel-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 10px;
    background: var(--lcars-orange);
    border-radius: 0 20px 20px 0;
}

.lcars-panel-widget::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 10px;
    background: var(--lcars-orange);
    border-radius: 0 20px 20px 0;
}

.lcars-panel__corner {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--lcars-orange);
}

.lcars-panel__corner--top-left {
    top: 0;
    left: 0;
    border-radius: 0 0 60px 0;
}

.lcars-panel__corner--bottom-right {
    bottom: 0;
    right: 0;
    border-radius: 60px 0 0 0;
}

.lcars-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333333;
}

.lcars-panel__title {
    font-family: var(--lcars-font-secondary);
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lcars-purple);
    margin: 0;
}

.lcars-panel__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lcars-panel__indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lcars-green);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.lcars-panel__content {
    color: #CCCCCC;
    line-height: 1.8;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .lcars-button__content {
        padding: 0.5em 1.5em;
        font-size: 0.875rem;
    }
    
    .lcars-card-widget {
        padding: 1.5rem;
    }
    
    .lcars-navigation {
        flex-direction: column;
        border-radius: 30px 30px 0 0;
    }
    
    .lcars-navigation__bar {
        width: 100%;
        height: 10px;
    }
    
    .lcars-navigation__menu {
        flex-direction: column;
    }
    
    .lcars-panel-widget {
        padding: 1.5rem;
    }
}

/* =========================================
   Print Styles
   ========================================= */
@media print {
    .lcars-button,
    .lcars-card-widget,
    .lcars-navigation,
    .lcars-panel-widget {
        border: 1px solid #000000;
        background: white;
        color: #000000;
    }
    
    .lcars-button__particles,
    .lcars-button__effect,
    .lcars-card-widget::before,
    .lcars-card-widget::after,
    .lcars-panel-widget::before,
    .lcars-panel-widget::after {
        display: none;
    }
}