/**
 * TRINEX BUTTONS v1.0 - CSS
 * Dedem için özel hazırlanmış buton stilleri
 * Şekilli, hover efektli, köşeleri öne çıkan tasarım
 */

/* ============================================
   BASE BUTTON
   ============================================ */
.trinex-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
    white-space: nowrap;
    isolation: isolate;
}

.trinex-btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.trinex-btn-text {
    position: relative;
    transition: transform 0.3s ease;
}

.trinex-btn-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

/* ============================================
   SIZE VARIANTS
   ============================================ */
.trinex-btn-xs {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 28px;
}

.trinex-btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    min-height: 32px;
}

.trinex-btn-md {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
}

.trinex-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    min-height: 48px;
}

.trinex-btn-xl {
    padding: 18px 36px;
    font-size: 18px;
    min-height: 56px;
}

/* ============================================
   ROUNDED VARIANTS
   ============================================ */
.trinex-btn-rounded-none {
    border-radius: 0;
}

.trinex-btn-rounded-sm {
    border-radius: 4px;
}

.trinex-btn-rounded-md {
    border-radius: 8px;
}

.trinex-btn-rounded-lg {
    border-radius: 12px;
}

.trinex-btn-rounded-full {
    border-radius: 50px;
}

/* ============================================
   SOLID VARIANT (Default)
   ============================================ */
.trinex-btn-solid {
    background: var(--btn-color);
    color: var(--btn-text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

    .trinex-btn-solid:hover {
        background: var(--btn-hover-color);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

    .trinex-btn-solid:active {
        transform: translateY(0);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

/* ============================================
   OUTLINE VARIANT
   ============================================ */
.trinex-btn-outline {
    background: transparent;
    color: var(--btn-color);
    box-shadow: inset 0 0 0 2px var(--btn-color);
}

    .trinex-btn-outline:hover {
        background: var(--btn-color);
        color: var(--btn-text-color);
        transform: translateY(-2px);
        box-shadow: inset 0 0 0 2px var(--btn-color), 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .trinex-btn-outline:active {
        transform: translateY(0);
    }

/* ============================================
   GHOST VARIANT
   ============================================ */
.trinex-btn-ghost {
    background: transparent;
    color: var(--btn-color);
    box-shadow: none;
}

    .trinex-btn-ghost:hover {
        background: var(--btn-color);
        background: rgba(0, 0, 0, 0.05);
        color: var(--btn-hover-color);
    }

    .trinex-btn-ghost:active {
        background: rgba(0, 0, 0, 0.1);
    }

/* ============================================
   GRADIENT VARIANT
   ============================================ */
.trinex-btn-gradient {
    background: linear-gradient(135deg, var(--btn-color) 0%, var(--btn-hover-color) 100%);
    color: var(--btn-text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

    .trinex-btn-gradient:hover {
        background: linear-gradient(135deg, var(--btn-hover-color) 0%, var(--btn-color) 100%);
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }

    .trinex-btn-gradient:active {
        transform: translateY(0) scale(1);
    }

/* ============================================
   SHINE EFFECT (Parlama)
   ============================================ */
.trinex-btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.3), transparent );
    z-index: 1;
    transition: left 0.5s ease;
}

.trinex-btn:hover .trinex-btn-shine {
    left: 100%;
}

/* ============================================
   BORDER EFFECT (Köşe Efekti)
   ============================================ */
.trinex-btn-border-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
}

    /* Köşe çizgileri - hover'da görünür */
    .trinex-btn-border-effect::before,
    .trinex-btn-border-effect::after {
        content: '';
        position: absolute;
        background: var(--btn-text-color);
        transition: all 0.3s ease;
        opacity: 0;
    }

    /* Sol üst ve sağ alt köşeler */
    .trinex-btn-border-effect::before {
        top: 4px;
        left: 4px;
        width: 0;
        height: 2px;
    }

    .trinex-btn-border-effect::after {
        bottom: 4px;
        right: 4px;
        width: 0;
        height: 2px;
    }

/* Hover'da köşeler görünür */
.trinex-btn:hover .trinex-btn-border-effect::before,
.trinex-btn:hover .trinex-btn-border-effect::after {
    width: 20px;
    opacity: 0.5;
}

/* Dikey köşe çizgileri için pseudo element trick */
.trinex-btn::before,
.trinex-btn::after {
    content: '';
    position: absolute;
    background: var(--btn-text-color);
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 3;
}

.trinex-btn::before {
    top: 4px;
    left: 4px;
    width: 2px;
    height: 0;
}

.trinex-btn::after {
    bottom: 4px;
    right: 4px;
    width: 2px;
    height: 0;
}

.trinex-btn:hover::before,
.trinex-btn:hover::after {
    height: 20px;
    opacity: 0.5;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.trinex-btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: trinexRipple 0.6s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes trinexRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.trinex-btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.trinex-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: trinexSpin 0.8s linear infinite;
}

@keyframes trinexSpin {
    to {
        transform: rotate(360deg);
    }
}

.trinex-btn-lg .trinex-btn-spinner,
.trinex-btn-xl .trinex-btn-spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

/* ============================================
   DISABLED STATE
   ============================================ */
.trinex-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

    .trinex-btn-disabled:hover {
        transform: none;
        box-shadow: none;
    }

/* ============================================
   FULL WIDTH
   ============================================ */
.trinex-btn-full {
    width: 100%;
}

/* ============================================
   HOVER ICON ANIMATION
   ============================================ */
.trinex-btn:hover .trinex-btn-icon {
    transform: scale(1.15);
}

/* Sağdaki ikon için farklı animasyon */
.trinex-btn .trinex-btn-text + .trinex-btn-icon {
    transition: transform 0.3s ease;
}

.trinex-btn:hover .trinex-btn-text + .trinex-btn-icon {
    transform: translateX(4px);
}

/* Soldaki ikon için */
.trinex-btn .trinex-btn-icon + .trinex-btn-text ~ .trinex-btn-icon {
    transform: none;
}

/* ============================================
   FOCUS STATE
   ============================================ */
.trinex-btn:focus-visible {
    outline: 3px solid var(--btn-color);
    outline-offset: 3px;
}

/* ============================================
   BUTTON GROUP
   ============================================ */
.trinex-btn-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trinex-btn-group-vertical {
    flex-direction: column;
}

.trinex-btn-group-connected {
    gap: 0;
}

    .trinex-btn-group-connected .trinex-btn {
        border-radius: 0;
    }

        .trinex-btn-group-connected .trinex-btn:first-child {
            border-top-left-radius: 8px;
            border-bottom-left-radius: 8px;
        }

        .trinex-btn-group-connected .trinex-btn:last-child {
            border-top-right-radius: 8px;
            border-bottom-right-radius: 8px;
        }

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Glow Effect */
.trinex-btn-glow:hover {
    box-shadow: 0 0 20px var(--btn-color), 0 0 40px var(--btn-color), 0 0 60px var(--btn-color);
}

/* Pulse Animation */
.trinex-btn-pulse {
    animation: trinexPulse 2s infinite;
}

@keyframes trinexPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--btn-color);
    }

    50% {
        box-shadow: 0 0 0 10px transparent;
    }
}

/* Bounce on Hover */
.trinex-btn-bounce:hover {
    animation: trinexBounce 0.5s ease;
}

@keyframes trinexBounce {
    0%, 100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-8px);
    }

    50% {
        transform: translateY(-4px);
    }

    75% {
        transform: translateY(-6px);
    }
}

/* 3D Effect */
.trinex-btn-3d {
    box-shadow: 0 4px 0 var(--btn-hover-color), 0 6px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

    .trinex-btn-3d:hover {
        transform: translateY(0);
        box-shadow: 0 2px 0 var(--btn-hover-color), 0 3px 5px rgba(0, 0, 0, 0.15);
    }

    .trinex-btn-3d:active {
        transform: translateY(2px);
        box-shadow: 0 0 0 var(--btn-hover-color), 0 1px 2px rgba(0, 0, 0, 0.1);
    }

/* ============================================
   ICON ONLY BUTTON
   ============================================ */
.trinex-btn-icon-only {
    padding: 0;
    aspect-ratio: 1;
}

    .trinex-btn-icon-only.trinex-btn-xs {
        width: 28px;
    }

    .trinex-btn-icon-only.trinex-btn-sm {
        width: 32px;
    }

    .trinex-btn-icon-only.trinex-btn-md {
        width: 40px;
    }

    .trinex-btn-icon-only.trinex-btn-lg {
        width: 48px;
    }

    .trinex-btn-icon-only.trinex-btn-xl {
        width: 56px;
    }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .trinex-btn-md {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
    }

    .trinex-btn-lg {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 40px;
    }
}
