/**
 * @file: details.php
 * @description: Премиум стили для визитной карточки компании с 3D эффектами
 * @dependencies: Inter font, Bootstrap Icons
 * @created: 2025-07-01
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors */
    --primary-red: #ee3831;
    --primary-red-dark: #d32f2a;
    --primary-red-light: #ff5722;
    --dark-bg: #0a0a0a;
    --dark-surface: #1a1a1a;
    --dark-surface-alt: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #ee3831 0%, #ff5722 100%);
    --gradient-glass: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    --gradient-dark: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    --gradient-text: linear-gradient(135deg, #ee3831 0%, #ff5722 100%);

    /* Shadows */
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.37);
    --shadow-primary: 0 20px 40px rgba(238, 56, 49, 0.3);
    --shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Animation */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Spacing */
    --section-padding: 6rem 0;
    --container-max-width: 1200px;
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== BACKGROUND ELEMENTS ===== */
.bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
            rgba(238, 56, 49, 0.1) 1px,
            transparent 1px
        ),
        linear-gradient(90deg, rgba(238, 56, 49, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(238, 56, 49, 0.4) 0%,
        transparent 70%
    );
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(255, 87, 34, 0.3) 0%,
        transparent 70%
    );
    bottom: 20%;
    left: 10%;
    animation-delay: 4s;
}

.my-detail-card {
    min-height: calc(100vh - 120px); /* Высота экрана минус отступ для футера */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 60px; /* Отступ сверху для компенсации высоты навигации */
    padding-bottom: 60px; /* Отступ снизу для компенсации футера */
    margin-top: 70px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(238, 56, 49, 0.1);
    border: 1px solid rgba(238, 56, 49, 0.3);
    border-radius: 50px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out 0.7s both;
}

.badge-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-red);
    position: relative;
    z-index: 2;
}

.badge-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(238, 56, 49, 0.2),
        transparent
    );
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes gridMove {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(50px) translateY(50px);
    }
}

@keyframes orbFloat {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* ===== NAVIGATION ===== */
.nav-glass {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100%;
    padding: 1rem 0;
    background: transparent;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: var(--transition-smooth);
    box-sizing: border-box;
    overflow: hidden;
}

.nav-container {
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.nav-logo img {
    height: 40px;
    width: auto;
    animation: fadeIn 0.2s ease-out 0.7s both;
}

/* ===== 3D VISUAL ===== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    animation: fadeIn 0.2s ease-out 0.7s both;
}

.visual-3d {
    position: relative;
    width: 75px;
    height: 75px;
}

.cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    transform-style: preserve-3d;
    animation: cubeRotate 20s linear infinite;
}

.cube {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: 55px;
    height: 55px;
    background: var(--glass-bg);
    border: 2px solid var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-red);
    backdrop-filter: blur(20px);
}

.face.front {
    transform: rotateY(0deg) translateZ(27px);
}
.face.back {
    transform: rotateY(180deg) translateZ(27px);
}
.face.right {
    transform: rotateY(90deg) translateZ(27px);
}
.face.left {
    transform: rotateY(-90deg) translateZ(27px);
}
.face.top {
    transform: rotateX(90deg) translateZ(27px);
}
.face.bottom {
    transform: rotateX(-90deg) translateZ(27px);
}

@keyframes cubeRotate {
    0% {
        transform: translate(-50%, -50%) rotateX(0) rotateY(0);
    }
    100% {
        transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg);
    }
}

/* ===== FOOTER ===== */
.footer-premium {
    position: fixed;
    padding: 2rem 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.8);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    z-index: 100;
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
}

.footer-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--primary-red);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes badgeGlow {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .cube-container {
        width: 50px;
        height: 50px;
    }

    .face {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .face.front {
        transform: rotateY(0deg) translateZ(25px);
    }
    .face.back {
        transform: rotateY(180deg) translateZ(25px);
    }
    .face.right {
        transform: rotateY(90deg) translateZ(25px);
    }
    .face.left {
        transform: rotateY(-90deg) translateZ(25px);
    }
    .face.top {
        transform: rotateX(90deg) translateZ(25px);
    }
    .face.bottom {
        transform: rotateX(-90deg) translateZ(25px);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 0;
    }

    .footer-container {
        padding-left: 1rem;
        padding-right: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-premium {
        padding: 1.5rem 0;
    }

    .my-detail-card {
        min-height: calc(100vh - 100px);
        padding-top: 40px;
        padding-bottom: 60px;
        margin-top: 70px;
    }

    .nav-glass {
        padding: 0.8rem 0;
    }

    .nav-logo img {
        height: 32px;
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 2rem 0;
        --border-radius: 12px;
        --border-radius-lg: 16px;
    }

    body {
        font-size: 14px;
    }

    .nav-container {
        padding: 0.5rem 0.5rem;
        max-width: calc(100vw - 1rem);
        padding-right: 2rem;
    }

    .nav-glass {
        width: 100vw;
        max-width: 100%;
        left: 0;
        right: 0;
    }

    .cube-container {
        width: 40px;
        height: 40px;
    }

    .hero-badge {
        display: none;
    }

    .face {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        color: var(--primary-red);
    }

    .my-detail-card {
        min-height: calc(100vh - 80px);
        padding-top: 30px;
        padding-bottom: 50px;
        margin-top: 70px;
    }

    .face.front {
        transform: rotateY(0deg) translateZ(19px);
    }
    .face.back {
        transform: rotateY(180deg) translateZ(19px);
    }
    .face.right {
        transform: rotateY(90deg) translateZ(19px);
    }
    .face.left {
        transform: rotateY(-90deg) translateZ(19px);
    }
    .face.top {
        transform: rotateX(90deg) translateZ(19px);
    }
    .face.bottom {
        transform: rotateX(-90deg) translateZ(19px);
    }

    .visual-3d {
        width: 40px;
        height: 40px;
    }

    /* Скрыть 3D эффекты на очень маленьких экранах для производительности */
    .gradient-orb {
        display: none;
    }

    .grid-overlay {
        opacity: 0.3;
    }

    /* Упрощение анимаций для мобильных */
    .cube-container {
        animation-duration: 27s;
    }

    .hero-badge .badge-glow {
        animation: none;
    }

    .footer-logo {
        display: none;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.visible {
    opacity: 1 !important;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ МОБИЛЬНЫЕ ИСПРАВЛЕНИЯ ===== */
@media (max-width: 375px) {
    .nav-container {
        padding: 0 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }

    .nav-glass {
        width: 100vw;
        max-width: 100%;
    }
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ ЛАНДШАФТНОЙ ОРИЕНТАЦИИ ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .visual-3d {
        width: 150px;
        height: 150px;
    }

    .cube-container {
        width: 80px;
        height: 80px;
    }

    .face {
        width: 80px;
        height: 80px;
        font-size: 1rem;
    }

    .face.front {
        transform: rotateY(0deg) translateZ(40px);
    }
    .face.back {
        transform: rotateY(180deg) translateZ(40px);
    }
    .face.right {
        transform: rotateY(90deg) translateZ(40px);
    }
    .face.left {
        transform: rotateY(-90deg) translateZ(40px);
    }
    .face.top {
        transform: rotateX(90deg) translateZ(40px);
    }
    .face.bottom {
        transform: rotateX(-90deg) translateZ(40px);
    }
}

/* ===== УЛУЧШЕНИЕ ПРОИЗВОДИТЕЛЬНОСТИ НА МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .bg-elements {
        will-change: auto;
    }

    .gradient-orb {
        animation-duration: 12s;
        filter: blur(40px);
    }

    .grid-overlay {
        background-size: 30px 30px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cube-container {
        animation: none;
    }

    .grid-overlay {
        animation: none;
    }

    .gradient-orb {
        animation: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .nav-glass {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
