/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #c2fdff 0%, #cb9bf7 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Paper Texture Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, transparent 20%, rgba(255,255,255,0.3) 21%, rgba(255,255,255,0.3) 34%, transparent 35%, transparent),
        linear-gradient(50deg, #EDEEF7 0%, #E4FBFF 30%);
    background-size: 30px 30px, 20px 20px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* App Container */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(120, 104, 230, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #B8B5FF 20%, #7868E6 50%, #B8B5FF 80%, transparent);
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(120, 104, 230, 0.2));
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

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

.header-title-group {
    text-align: left;
    flex: 1;
    min-width: 280px;
    max-width: 500px;
}

.app-header h1 {
    font-size: 2rem;
    color: #7868E6;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
    margin: 0;
}

.header-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(120, 104, 230, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #7868E6;
    font-family: 'Courier New', monospace;
}

.stat-label {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(120, 104, 230, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Card Styles */
.config-card,
.session-header,
.counter-section,
.history-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(120, 104, 230, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

.config-card:hover,
.session-header:hover,
.counter-section:hover {
    box-shadow: 0 12px 40px rgba(120, 104, 230, 0.15);
    transform: translateY(-2px);
}

.config-card::before,
.session-header::before,
.counter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #B8B5FF, #7868E6);
    border-radius: 16px 16px 0 0;
}

/* Session Configuration */
.session-config {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.session-config h2 {
    color: #7868E6;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.config-description {
    text-align: center;
    color: #999;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.label-icon {
    font-size: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E4FBFF;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.input-group input:focus {
    outline: none;
    border-color: #7868E6;
    box-shadow: 0 0 0 3px rgba(120, 104, 230, 0.1);
    transform: translateY(-2px);
}

.input-hint {
    display: block;
    margin-top: 0.5rem;
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
}

/* Info Card */
.info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 247, 255, 0.95));
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid rgba(184, 181, 255, 0.4);
    box-shadow: 0 4px 20px rgba(120, 104, 230, 0.08);
    backdrop-filter: blur(10px);
}

.info-card h3 {
    color: #7868E6;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-icon {
    color: #7868E6;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-action {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon-inline {
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #7868E6, #B8B5FF);
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(120, 104, 230, 0.3);
}

.btn-secondary {
    background: rgba(228, 251, 255, 0.8);
    color: #7868E6;
    border: 2px solid #7868E6;
}

.btn-secondary:hover {
    background: #7868E6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.2);
}

.btn-action {
    background: rgba(184, 181, 255, 0.15);
    color: #7868E6;
    border: 2px solid rgba(120, 104, 230, 0.3);
    padding: 12px 20px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 140px;
}

.btn-action .action-icon {
    font-size: 1.3rem;
}

.btn-action:hover:not(:disabled) {
    background: rgba(184, 181, 255, 0.3);
    border-color: #7868E6;
    transform: translateY(-2px);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-undo:hover:not(:disabled) {
    background: rgba(255, 180, 180, 0.2);
    border-color: #d63384;
    color: #d63384;
}

.btn-pause:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #e6a800;
}

/* Active Session */
.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.session-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.session-info h2 {
    color: #7868E6;
    margin: 0;
    font-size: 1.5rem;
}

.session-details {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(184, 181, 255, 0.1);
    border-radius: 8px;
}

.detail-icon {
    font-size: 1.2rem;
}

.session-time {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7868E6;
    font-family: 'Courier New', monospace;
}

.session-goal {
    color: #666;
    font-weight: 500;
}

.session-help {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 8px;
}

.help-text {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Counter Section */
.movement-counter {
    text-align: center;
    margin-bottom: 2rem;
}

.counter-display {
    margin-bottom: 2rem;
}

.counter-number {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    color: #7868E6;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.counter-number.updated {
    animation: number-pop 0.4s ease;
}

@keyframes number-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #B8B5FF; }
    100% { transform: scale(1); }
}

.counter-label {
    font-size: 1.2rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.counter-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #B8B5FF, #7868E6);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(120, 104, 230, 0.3);
}

.counter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(120, 104, 230, 0.4);
}

.counter-btn:active {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 2rem;
    margin-top: 0.5rem;
}

/* Progress Section */
.progress-section {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(228, 251, 255, 0.5);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #B8B5FF, #7868E6);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

/* Session Actions */
.session-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0;
}

/* Session History */
.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: #7868E6;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.section-subtitle {
    color: #999;
    font-size: 0.95rem;
}

.history-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(228, 251, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.history-item:hover {
    background: rgba(184, 181, 255, 0.05);
    transform: translateX(5px);
    padding-left: 1.5rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-details {
    flex: 1;
}

.history-date {
    font-weight: bold;
    color: #7868E6;
    margin-bottom: 0.25rem;
}

.history-stats {
    color: #666;
    font-size: 0.9rem;
}

.history-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(184, 181, 255, 0.2);
    color: #7868E6;
}

.badge-warning {
    background: rgba(255, 180, 180, 0.2);
    color: #d63384;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.no-data-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.no-data p {
    font-size: 1.1rem;
    margin: 0;
}

.no-data small {
    font-size: 0.9rem;
    color: #bbb;
}

/* Notifications */
.notification-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-left: 4px solid #7868E6;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    color: #666;
}

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #7868E6;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid rgba(120, 104, 230, 0.1);
}

.app-footer p {
    margin: 0.5rem 0;
}

.app-footer a {
    color: #7868E6;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-footer a:hover {
    color: #B8B5FF;
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #7868E6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #B8B5FF;
    text-decoration: underline;
}

.footer-divider {
    color: #ccc;
}

.footer-contact {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.footer-contact a {
    color: #7868E6;
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .header-brand {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-title-group {
        text-align: center;
        min-width: auto;
    }
    
    .header-logo {
        width: 70px;
        height: 70px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .config-card,
    .session-header,
    .counter-section {
        padding: 1.5rem;
    }
    
    .info-card {
        padding: 1.25rem;
    }
    
    .info-list li {
        font-size: 0.9rem;
    }
    
    .session-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .session-status {
        justify-content: center;
    }
    
    .session-details {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .detail-item {
        min-width: 200px;
        justify-content: center;
    }
    
    .counter-btn {
        width: 150px;
        height: 150px;
        font-size: 1rem;
    }
    
    .counter-number {
        font-size: 3rem;
    }
    
    .btn-icon {
        font-size: 1.5rem;
    }
    
    .session-actions {
        width: 100%;
    }
    
    .btn-action {
        flex: 1;
        min-width: auto;
    }
    
    .history-controls {
        width: 100%;
    }
    
    .history-controls .btn-secondary {
        flex: 1;
    }
    
    .history-item {
        flex-direction: column;
        text-align: center;
    }
    
    .notification-panel {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1.5rem 1rem;
    }
    
    .header-logo {
        width: 60px;
        height: 60px;
    }
    
    .app-header h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .header-stats {
        gap: 0.75rem;
        padding-top: 1rem;
        flex-wrap: wrap;
    }
    
    .stat-item {
        flex: 1;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .config-card,
    .counter-section {
        padding: 1rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .info-list li {
        font-size: 0.85rem;
    }
    
    .counter-btn {
        width: 120px;
        height: 120px;
        font-size: 0.9rem;
    }
    
    .counter-number {
        font-size: 2.5rem;
    }
    
    .session-time {
        font-size: 1.2rem;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 14px 20px;
    }
    
    .btn-action {
        font-size: 0.85rem;
        padding: 10px 16px;
    }
    
    .action-text {
        display: none;
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
}

/* Animation Classes */
.bounce-in {
    animation: bounceIn 0.6s ease;
}

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

.pulse {
    animation: pulse 0.3s ease;
}

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

/* Focus and Accessibility */
button:focus,
input:focus {
    outline: 2px solid #7868E6;
    outline-offset: 2px;
}

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