/* Attuned - Modern Masculine Design */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --dark-bg: #34495e;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 5px 20px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f8f9fa;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--gradient-primary);
    padding: 1rem 0;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin-left: auto;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

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

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-light);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

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

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

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

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:invalid {
    border-color: var(--accent-color);
}

.form-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Feedback System */
.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.feedback-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.feedback-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.feedback-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(52, 152, 219, 0.5);
}

.feedback-btn:hover::before {
    width: 80px;
    height: 80px;
}

.feedback-btn:active {
    transform: scale(1.05);
    transition: transform 0.1s ease;
}

/* Individual button hover states for each rating */
.feedback-btn[data-rating="🔥"]:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.feedback-btn[data-rating="👍"]:hover {
    border-color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}

.feedback-btn[data-rating="🤷"]:hover {
    border-color: #ffd43b;
    background: rgba(255, 212, 59, 0.1);
}

.feedback-btn[data-rating="❌"]:hover {
    border-color: #ff8787;
    background: rgba(255, 135, 135, 0.1);
}

/* Active states with enhanced visual feedback */
.feedback-btn.active {
    animation: feedbackSuccess 0.6s ease forwards;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2), 0 6px 20px rgba(52, 152, 219, 0.3);
}

.feedback-btn[data-rating="🔥"].active {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2), 0 6px 20px rgba(255, 107, 107, 0.4);
}

.feedback-btn[data-rating="👍"].active {
    border-color: #51cf66;
    background: linear-gradient(135deg, #51cf66 0%, #41b855 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(81, 207, 102, 0.2), 0 6px 20px rgba(81, 207, 102, 0.4);
}

.feedback-btn[data-rating="🤷"].active {
    border-color: #ffd43b;
    background: linear-gradient(135deg, #ffd43b 0%, #ffcd3c 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(255, 212, 59, 0.2), 0 6px 20px rgba(255, 212, 59, 0.4);
}

.feedback-btn[data-rating="❌"].active {
    border-color: #ff8787;
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(255, 135, 135, 0.2), 0 6px 20px rgba(255, 135, 135, 0.4);
}

/* Loading state */
.feedback-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
    animation: feedbackPulse 1.5s ease-in-out infinite;
}

.feedback-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: feedbackSpin 0.8s linear infinite;
}

/* Disabled state */
.feedback-btn:disabled,
.feedback-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.feedback-btn:disabled:hover,
.feedback-btn.disabled:hover {
    border-color: var(--border-color);
    background: none;
}

/* Success state animation trigger */
.feedback-btn.success {
    animation: feedbackBounce 0.6s ease;
}

/* Focus state for accessibility */
.feedback-btn:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

.feedback-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* Prompt Display */
.prompt-card {
    background: var(--gradient-secondary);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.prompt-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.prompt-text {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.prompt-meta {
    font-size: 0.9rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

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

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cycle Indicator */
.cycle-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.cycle-day {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.cycle-phase {
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: 20px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

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

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

/* Feedback button animations */
@keyframes feedbackSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes feedbackBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-8px) scale(1.05);
    }
    60% {
        transform: translateY(-4px) scale(1.02);
    }
}

@keyframes feedbackPulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.03);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

@keyframes feedbackSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes feedbackGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.6), 0 0 30px rgba(52, 152, 219, 0.4);
    }
}

/* Enhanced feedback button animations for loading, success, and error states */
@keyframes successPulse {
    0% {
        transform: scale(1);
        background: var(--success-color);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        transform: scale(1);
        background: var(--success-color);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
        background: var(--accent-color);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}

@keyframes spinnerRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Feedback button state classes */
.feedback-btn.loading {
    pointer-events: none;
    background: var(--light-bg);
    border-color: var(--border-color);
}

.feedback-btn.success-pulse {
    animation: successPulse 1s ease-out;
    color: white;
}

.feedback-btn.error-shake {
    animation: errorShake 0.5s ease-in-out;
    color: white;
}

/* Spinner for loading state */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spinnerRotate 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .navbar-nav {
        gap: 1rem;
    }

    .feedback-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .feedback-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .feedback-btn:hover {
        transform: scale(1.1);
    }

    .feedback-btn:hover::before {
        width: 60px;
        height: 60px;
    }

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

    .metric-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .cycle-indicator {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #2c3e50;
        --text-primary: #ecf0f1;
        --text-secondary: #bdc3c7;
        --border-color: #34495e;
    }

    body {
        background-color: #1a1a1a;
        color: var(--text-primary);
    }

    .card {
        background: var(--dark-bg);
        border-color: var(--border-color);
    }

    .form-control {
        background: var(--dark-bg);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feedback-btn::before {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feedback-btn {
        border-width: 3px;
    }
    
    .feedback-btn:hover {
        border-color: ButtonText;
    }
    
    .feedback-btn.active {
        background: ButtonText;
        color: ButtonFace;
        border-color: ButtonText;
    }
    
    .feedback-btn:focus {
        outline: 3px solid Highlight;
        outline-offset: 2px;
    }
}

/* Text Feedback Styles */
.feedback-text-container {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feedback-text-container.show {
    opacity: 1;
    transform: translateY(0);
}

.feedback-prompt-text {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.feedback-text-input {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 80px;
    background: white;
}

.feedback-text-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.feedback-text-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.feedback-text-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.feedback-text-footer small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.feedback-text-footer .btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.feedback-text-footer .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    min-width: 80px;
}

.feedback-text-footer .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.feedback-text-footer .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.feedback-text-footer .btn-outline-secondary:hover {
    background: var(--light-bg);
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* Character counter styles */
#char-count {
    font-weight: 500;
    transition: color 0.2s ease;
}

.feedback-text-input:invalid + .feedback-text-footer #char-count,
.feedback-text-input[data-over-limit="true"] + .feedback-text-footer #char-count {
    color: #dc3545;
}

/* Dark theme support for text feedback */
.dark-theme .feedback-text-container {
    background: rgba(45, 55, 72, 0.95);
    border-color: var(--dark-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme .feedback-text-input {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-theme .feedback-text-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.dark-theme .feedback-text-footer {
    border-color: var(--dark-border);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .feedback-text-container {
        padding: 1rem;
        margin-top: 0.75rem;
    }

    .feedback-text-input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .feedback-text-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.5rem;
    }

    .feedback-text-footer > div {
        display: flex;
        gap: 0.5rem;
    }

    .feedback-text-footer .btn {
        flex: 1;
        font-size: 0.85rem;
    }
}

/* Animation for smooth reveal */
@keyframes textFeedbackSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
}

.feedback-text-container.show {
    animation: textFeedbackSlideIn 0.3s ease;
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .feedback-buttons {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
        color: black;
    }
}
