/* Universal box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Portfolio page body adjustments */
body {
    padding-top: 80px;
}

/* Portfolio specific variables */
:root {
    --primary-color: #F47720;
    --secondary-color: #6c757d;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --dark: #2c3e50;
    --gradient-primary: linear-gradient(135deg, #F47720 0%, #FF8A3D 100%);
    --gradient-secondary: linear-gradient(135deg, #6c757d 0%, #8a9199 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
}

/* Page Header */
.page-header {
    background: white;
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Services Section */
.services-section {
    background: #f8f9fa;
    padding: 3rem 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.service-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.service-icon.blue {
    background: linear-gradient(135deg, #3498DB 0%, #5dade2 100%);
}

.service-icon.green {
    background: linear-gradient(135deg, #27AE60 0%, #52c77a 100%);
}

.service-icon.red {
    background: linear-gradient(135deg, #E74C3C 0%, #ec7063 100%);
}

.service-icon.orange {
    background: linear-gradient(135deg, #F47720 0%, #FF8A3D 100%);
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.service-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-section {
        padding: 2rem 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.5rem 1rem;
    }
}

/* Portfolio Categories */
.portfolio-categories {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    padding: 2.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.tab-button {
    background: white;
    border: 2px solid #F47720;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #F47720;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 119, 32, 0.1);
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F47720 0%, #FF8A3D 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.tab-button:hover::before,
.tab-button.active::before {
    left: 0;
}

.tab-button:hover,
.tab-button.active {
    border-color: #F47720;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(244, 119, 32, 0.25);
}

.tab-button:active {
    transform: translateY(-1px);
}

/* Portfolio Sections */
.portfolio-section {
    padding: 4rem 0;
    display: block;
}

.portfolio-section.hidden {
    display: none;
}

.portfolio-section.active {
    display: block;
}

/* Hide sections with empty grids */
.portfolio-section:has(.portfolio-grid:empty) {
    display: none;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    align-items: stretch;
    justify-items: stretch;
}

/* Tombstone Style Portfolio Cards */
.portfolio-card {
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 1.2rem;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    height: auto;
    flex-shrink: 0;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent-color, #F47720);
}

.industry-tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    text-align: center;
    margin: 0 auto;
}

.card-content {
    padding: 1.5rem 1.2rem;
    min-height: 280px;
    height: auto;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
}

.deal-type {
    background: var(--accent-color, #F47720);
    color: white;
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 auto 1rem auto;
    border-radius: 2px;
    display: inline-block;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    height: 2rem;
    width: fit-content;
    flex-shrink: 0;
}

.company-info {
    margin-bottom: 0.5rem;
    min-height: 6rem;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

.company-logo {
    max-width: 100px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 2.5rem;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.project-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    font-style: italic;
    min-height: 3rem;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 0 0.5rem;
}

.deal-separator {
    width: 60px;
    height: 2px;
    background: var(--accent-color, #F47720);
    margin: 0.5rem auto;
    flex-shrink: 0;
}

.deal-details {
    min-height: 6rem;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.project-details {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
    text-align: center;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    padding: 0.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 6rem;
    flex-shrink: 0;
}

.deal-footer {
    background: #f8f9fa;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.deal-amount {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color, #F47720);
    margin-bottom: 0.3rem;
    text-align: center;
    line-height: 1.4;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.deal-year {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

/* Category-specific styling */
.portfolio-card[data-type="ma-sell"] {
    --accent-color: #F47720;
}

.portfolio-card[data-type="ma-buy"] {
    --accent-color: #27AE60;
}

.portfolio-card[data-type="strategy"] {
    --accent-color: #3498DB;
}

/* Status indicator */
.deal-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #27AE60;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.deal-status.pending {
    background: #F39C12;
}

.deal-status.completed {
    background: #27AE60;
}

.result {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border-left: 3px solid #4caf50;
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    flex-shrink: 0;
    line-height: 1.3;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cta-section .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 2rem 0 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .portfolio-card {
        margin: 0;
        height: 350px;
    }

    .category-tabs {
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .tab-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1.5rem 0 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .category-tabs {
        flex-direction: column;
        align-items: center;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portfolio-card {
        margin: 0;
        height: 380px;
    }

    .card-header {
        padding: 0.6rem 1rem;
        min-height: 40px;
    }

    .card-content {
        padding: 1rem;
    }

    .project-title {
        font-size: 1rem;
        min-height: 2rem;
    }

    .project-description {
        font-size: 0.8rem;
    }

    .project-details {
        font-size: 0.75rem;
    }
}

/* Animation for portfolio cards */
.portfolio-grid .portfolio-card {
    animation: fadeInUp 0.6s ease forwards;
}

.portfolio-grid .portfolio-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-grid .portfolio-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-grid .portfolio-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-grid .portfolio-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-grid .portfolio-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-grid .portfolio-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Footer styles removed - using styles-ru.css for consistent footer across all pages */