/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background: #0f0f0f;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    position: relative;
    overflow: auto;
}

/* Animated Background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff, #ff0000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0.15;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 50px;
    z-index: 1;
}

.glowing-text {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px #fff,
                 0 0 20px #fff,
                 0 0 30px #e60073,
                 0 0 40px #e60073;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #fff,
                     0 0 20px #fff,
                     0 0 30px #e60073,
                     0 0 40px #e60073;
    }
    to {
        text-shadow: 0 0 20px #fff,
                     0 0 30px #ff4da6,
                     0 0 40px #ff4da6,
                     0 0 50px #ff4da6;
    }
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #ccc;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Button Styles */
.button-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin-top: 20px;
    z-index: 1;
}

.neon-btn {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    text-align: center;
    border-radius: 5px;
    color: #03e9f4;
    text-decoration: none;
    overflow: hidden;
    background: rgba(3, 233, 244, 0.1);
    transition: background 0.3s;
}

.neon-btn:hover {
    background: rgba(3, 233, 244, 0.2);
}

.neon-btn span {
    position: absolute;
    display: block;
}

.neon-btn span:nth-child(1) {
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #03e9f4);
    animation: btn-anim1 1s linear infinite;
}

@keyframes btn-anim1 {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.neon-btn span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #03e9f4);
    animation: btn-anim2 1s linear infinite;
    animation-delay: 0.25s;
}

@keyframes btn-anim2 {
    0% { top: -100%; }
    50%, 100% { top: 100%; }
}

.neon-btn span:nth-child(3) {
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg, transparent, #03e9f4);
    animation: btn-anim3 1s linear infinite;
    animation-delay: 0.5s;
}

@keyframes btn-anim3 {
    0% { right: -100%; }
    50%, 100% { right: 100%; }
}

.neon-btn span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(360deg, transparent, #03e9f4);
    animation: btn-anim4 1s linear infinite;
    animation-delay: 0.75s;
}

@keyframes btn-anim4 {
    0% { bottom: -100%; }
    50%, 100% { bottom: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .glowing-text {
        font-size: 2.5rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .neon-btn {
        margin-right: 0;
        text-align: center;
    }
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-10px);
}

.overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    transition: bottom 0.3s ease;
}

.portfolio-item:hover .overlay {
    bottom: 0;
}

/* Animations */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: white }
}

/* Custom Cursor */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
}

.cursor-follower {
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999;
}

/* 3D Cards */
.cards-wrapper {
    display: flex;
    gap: 2rem;
    padding: 4rem 2rem;
    perspective: 1000px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card:hover {
    transform: translateZ(20px) rotateX(10deg) rotateY(10deg);
}

/* Glowing Effect */
.hero-content h1 {
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5),
                 0 0 20px rgba(52, 152, 219, 0.3),
                 0 0 30px rgba(52, 152, 219, 0.1);
}

/* Particle Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 3D Cube Gallery */
.cube-gallery {
    perspective: 1000px;
    width: 300px;
    height: 300px;
    margin: 100px auto;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate 30s infinite linear;
}

.face {
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(52, 152, 219, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.front  { transform: translateZ(150px); }
.back   { transform: rotateY(180deg) translateZ(150px); }
.right  { transform: rotateY(90deg) translateZ(150px); }
.left   { transform: rotateY(-90deg) translateZ(150px); }
.top    { transform: rotateX(90deg) translateZ(150px); }
.bottom { transform: rotateX(-90deg) translateZ(150px); }

@keyframes rotate {
    from { transform: rotateX(0) rotateY(0); }
    to { transform: rotateX(360deg) rotateY(360deg); }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(45deg);
}

/* Light Theme Colors */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #3498db;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #64b5f6;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    display: flex;
    gap: 10px;
}

.circle {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: bounce 0.5s alternate infinite;
}

.circle:nth-child(2) { animation-delay: 0.2s; }
.circle:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    to { transform: translateY(-20px); }
}

/* Donate Button Styles */
.donate-button,
.software-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 200px;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.donate-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5253);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.software-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.donate-button:hover,
.software-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.donate-button:active,
.software-button:active {
    transform: translateY(2px);
}

.donate-button i {
    animation: heartbeat 1.5s ease infinite;
}

.software-button i {
    animation: bounce 1.5s ease infinite;
}

.donate-button::before,
.software-button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    background: inherit;
    filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s;
}

.donate-button:hover::before,
.software-button:hover::before {
    opacity: 0.7;
}

.donate-button::after,
.software-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: 0.5s;
}

.donate-button:hover::after,
.software-button:hover::after {
    left: 100%;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Responsive */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .donate-button,
    .software-button {
        width: 100%;
        max-width: 280px;
        padding: 12px 25px;
        font-size: 1em;
    }
}

/* Button Group Styles */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Software Button Styles */
.software-button.loading {
    background: linear-gradient(45deg, #3498db, #2980b9);
    background-size: 200% 200%;
    animation: gradient 1.5s ease infinite;
    pointer-events: none;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.projects-grid {
    width: 100%;
    padding: 20px;
}

/* สำหรับหน้า index.html */
.index-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* สำหรับหน้า projects.html */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
} 