/* ===================================
   GYMLY WEBSITE - MAIN STYLESHEET
   Following SOLID Principles
   =================================== */

/* ===================================
   BASE STYLES (Single Responsibility)
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Variables - Matching Flutter App Theme */
    --primary-color: #FF5733;
    --secondary-color: #00ADB5;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --primary-gradient-start: #FF5733;
    --primary-gradient-end: #00ADB5;
    --accent-color: #FF5733;
    --accent-hover: #E04A2B;
    --text-primary: #1F1F1F;
    --text-secondary: #666666;
    --text-light: #B3B3B3;
    --background-primary: #F5F5F5;
    --background-secondary: #FFFFFF;
    --background-dark: #121212;
    --background-card-dark: #1E1E1E;
    --border-color: #E5E5E5;
    --border-dark: #333333;
    
    /* Typography - Matching Flutter App */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --font-logo: 'Montserrat', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
    
    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-primary);
    overflow-x: hidden;
}

/* ===================================
   TYPOGRAPHY (Single Responsibility)
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===================================
   LAYOUT UTILITIES (Single Responsibility)
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section {
    padding: var(--spacing-2xl) 0;
}

.section:nth-child(even) {
    background: var(--background-secondary);
}

/* ===================================
   GRID SYSTEM (Single Responsibility)
   =================================== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===================================
   FLEXBOX UTILITIES (Single Responsibility)
   =================================== */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* ===================================
   BUTTON STYLES (Single Responsibility)
   =================================== */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-dark {
    background: var(--background-dark);
    color: white;
}

.btn-dark:hover {
    background: #374151;
    transform: translateY(-2px);
}

/* ===================================
   CARD STYLES (Single Responsibility)
   =================================== */
.card {
    background: var(--background-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes typewriter-mobile {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: var(--accent-color);
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-rotate-in {
    animation: rotateIn 1s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

.animate-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

.animate-gradient {
    background: linear-gradient(-45deg, #667eea, #764ba2, #10b981, #f59e0b);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
}

.animate-typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
    display: inline-block;
    max-width: 100%;
}

/* Responsive typewriter animation */
@media (min-width: 1200px) {
    .animate-typewriter {
        animation: typewriter 4s steps(50, end), blink 0.75s step-end infinite;
        max-width: 800px;
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .animate-typewriter {
        animation: typewriter 3.5s steps(45, end), blink 0.75s step-end infinite;
        max-width: 700px;
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .animate-typewriter {
        animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
        max-width: 600px;
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .animate-typewriter {
        white-space: normal;
        animation: typewriter-mobile 3s steps(30, end), blink 0.75s step-end infinite;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .animate-typewriter {
        animation: typewriter-mobile 2.5s steps(25, end), blink 0.75s step-end infinite;
    }
}

@media (max-width: 360px) {
    .animate-typewriter {
        animation: typewriter-mobile 2s steps(20, end), blink 0.75s step-end infinite;
    }
}

/* Initial state for animated elements */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   RESPONSIVE DESIGN (Single Responsibility)
   =================================== */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .flex {
        flex-direction: column;
    }
    
    /* Ensure text doesn't overflow on mobile */
    body {
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    /* Improve text wrapping */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
}

@media (max-width: 360px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.125rem; }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* ===================================
   UTILITY CLASSES (Single Responsibility)
   =================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

/* ===================================
   ACCESSIBILITY (Single Responsibility)
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ===================================
   PRINT STYLES (Single Responsibility)
   =================================== */
@media print {
    .header,
    .footer,
    .btn {
        display: none;
    }
    
    body {
        color: black;
        background: white;
    }
    
    .card {
        border: 1px solid black;
        box-shadow: none;
    }
}

