/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Container */
.container {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00d4ff 0%, #b537f2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.1rem;
    color: #e0e0e0;
    opacity: 0.8;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.name-input {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1.1rem;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.name-input:focus {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Random Button */
.random-btn {
    background: linear-gradient(135deg, #b537f2 0%, #8b2fc9 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(181, 55, 242, 0.3);
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(181, 55, 242, 0.5);
}

.random-btn:active {
    transform: translateY(0);
}

.random-icon {
    font-size: 1.2rem;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
    margin-bottom: 30px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.6);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: btnGlow 3s ease-in-out infinite;
}

/* Result Section */
.result-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-section.hidden {
    display: none;
}

/* Loading Animation */
.loading-container {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: #e0e0e0;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Result Display */
.result-display {
    text-align: center;
    width: 100%;
}

.result-display.hidden {
    display: none;
}

.score-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 20px;
}

.score-number {
    font-size: 6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00d4ff 0%, #b537f2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    animation: countUp 2s ease-out;
}

.score-percent {
    font-size: 3rem;
    font-weight: 700;
    color: #00d4ff;
    margin-left: 5px;
}

.score-comment {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 15px;
    animation: slideUp 0.5s ease-out;
}

/* Reset Button */
.reset-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.reset-btn.hidden {
    display: none;
}

/* History Section */
.history-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.clear-history-btn {
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.clear-history-btn:hover {
    background: rgba(255, 50, 50, 0.3);
    border-color: rgba(255, 50, 50, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 50, 50, 0.3);
}

.clear-history-btn:active {
    transform: translateY(0);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    padding: 20px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00d4ff;
    transform: translateX(5px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-names {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.history-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00d4ff;
}

.history-time {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Scrollbar Styles */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Animations */
@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }

    to {
        text-shadow: 0 0 40px rgba(0, 212, 255, 0.6), 0 0 60px rgba(181, 55, 242, 0.4);
    }
}

@keyframes btnGlow {

    0%,
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes countUp {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .input-section {
        padding: 20px;
    }

    .name-input {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .calculate-btn {
        padding: 18px;
        font-size: 1.2rem;
    }

    .score-number {
        font-size: 4.5rem;
    }

    .score-percent {
        font-size: 2.5rem;
    }

    .score-comment {
        font-size: 1.2rem;
    }

    .history-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .score-number {
        font-size: 3.5rem;
    }

    .score-percent {
        font-size: 2rem;
    }

    .score-comment {
        font-size: 1.1rem;
    }
}