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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    padding: 1rem 2rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.controls-group {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-item label {
    font-weight: 600;
    font-size: 1rem;
}

.control-item select {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 4px;
    border: 2px solid currentColor;
    cursor: pointer;
}

.theme-light .control-item select {
    background-color: #ffffff;
    color: #000000;
}

.theme-light .control-item select option {
    background-color: #ffffff;
    color: #000000;
}

.theme-dark .control-item select {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-dark .control-item select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-calm-blue .control-item select {
    background-color: #90caf9;
    color: #000000;
}

.theme-calm-blue .control-item select option {
    background-color: #90caf9;
    color: #000000;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.btn-fullscreen,
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-fullscreen {
    background-color: #2196F3;
    color: white;
}

.btn {
    background-color: #ddd;
    color: #333;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-warning {
    background-color: #FF9800;
    color: white;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.btn:hover,
.btn-fullscreen:hover {
    opacity: 0.85;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
}

.time-display {
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.timer-setup {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.timer-setup input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid currentColor;
    border-radius: 4px;
    background-color: transparent;
    color: inherit;
}

.timer-buttons {
    display: flex;
    gap: 1rem;
}

.next-break-info {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    min-height: 1.5rem;
}

.message-area {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.message-header > label {
    font-size: 1.2rem;
    font-weight: 600;
}

.auto-breaks-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.auto-breaks-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.break-timer-pause-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
}

.break-timer-pause-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.break-timer-pause-toggle span {
    flex: 1;
}

.formatting-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.font-size-dropdown {
    padding: 0.4rem 0.6rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 90px;
    margin-left: 0.25rem;
}

.theme-light .font-size-dropdown {
    background-color: #ffffff;
    color: #000000;
}

.theme-light .font-size-dropdown option {
    background-color: #ffffff;
    color: #000000;
}

.theme-dark .font-size-dropdown {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-dark .font-size-dropdown option {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-calm-blue .font-size-dropdown {
    background-color: #90caf9;
    color: #000000;
}

.theme-calm-blue .font-size-dropdown option {
    background-color: #90caf9;
    color: #000000;
}

.format-btn {
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid currentColor;
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.format-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.format-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

.message-area textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid currentColor;
    border-radius: 4px;
    resize: vertical;
    background-color: transparent;
    color: inherit;
    font-family: inherit;
}

.rich-text-editor {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    padding: 1rem;
    border: 2px solid currentColor;
    border-radius: 4px;
    background-color: transparent;
    color: inherit;
    font-size: 1rem;
    font-family: inherit;
    overflow-y: auto;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.rich-text-editor:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.rich-text-editor:focus {
    background-color: rgba(255, 255, 255, 0.05);
}

.message-display {
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    min-height: 2rem;
    padding: 0.75rem;
    white-space: pre-line;
    transition: font-size 0.2s;
}

.message-display b, .message-display strong {
    font-weight: 700;
}

.message-display i, .message-display em {
    font-style: italic;
}

.message-display u {
    text-decoration: underline;
}

.message-display .font-small {
    font-size: 1.1rem;
}

.message-display .font-medium {
    font-size: 1.4rem;
}

.message-display .font-large {
    font-size: 1.8rem;
}

.message-display .font-xlarge {
    font-size: 2.2rem;
}

.message-display .break-time {
    font-size: 1.275rem;
}

.breaks-panel {
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
    border: 2px solid currentColor;
    border-radius: 8px;
}

.breaks-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.break-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid currentColor;
}

.break-form label {
    font-weight: 600;
}

.break-form input {
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid currentColor;
    border-radius: 4px;
    background-color: transparent;
    color: inherit;
}

.break-form select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid currentColor;
    border-radius: 4px;
    cursor: pointer;
}

.theme-light .break-form select {
    background-color: #ffffff;
    color: #000000;
}

.theme-light .break-form select option {
    background-color: #ffffff;
    color: #000000;
}

.theme-dark .break-form select {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-dark .break-form select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-calm-blue .break-form select {
    background-color: #90caf9;
    color: #000000;
}

.theme-calm-blue .break-form select option {
    background-color: #90caf9;
    color: #000000;
}

.breaks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.break-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid currentColor;
    border-radius: 4px;
}

.break-item-info {
    font-size: 0.95rem;
}

.break-item button {
    padding: 0.5rem 1rem;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.break-item button:hover {
    opacity: 0.85;
}

.break-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.break-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.break-title {
    font-size: 5rem;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.break-countdown-display {
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.break-timer {
    font-size: 3.5rem;
    font-weight: 700;
}

.presentation-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.presentation-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 90%;
    max-width: 1200px;
}

.presentation-time {
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.presentation-message {
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.4;
    min-height: 3rem;
    white-space: pre-line;
    transition: font-size 0.2s;
}

.presentation-message b, .presentation-message strong {
    font-weight: 700;
}

.presentation-message i, .presentation-message em {
    font-style: italic;
}

.presentation-message u {
    text-decoration: underline;
}

.presentation-message .font-small {
    font-size: 1.5rem;
}

.presentation-message .font-medium {
    font-size: 2rem;
}

.presentation-message .font-large {
    font-size: 2.6rem;
}

.presentation-message .font-xlarge {
    font-size: 3.2rem;
}

.presentation-message .break-time {
    font-size: 0.9em;
}

.presentation-timer-controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.btn-presentation {
    padding: 1rem 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    color: white;
}

.btn-exit-presentation {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 3px solid currentColor;
    border-radius: 8px;
    background-color: transparent;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
}

.btn-exit-presentation:hover {
    background-color: currentColor;
    color: var(--bg-color);
}

.theme-light {
    --bg-color: #ffffff;
}

.theme-dark {
    --bg-color: #1a1a1a;
}

.theme-calm-blue {
    --bg-color: #e3f2fd;
}

.theme-light {
    background-color: #ffffff;
    color: #000000;
}

.theme-dark {
    background-color: #1a1a1a;
    color: #ffffff;
}

.theme-dark .top-bar {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.theme-dark .toggle-slider {
    background-color: #555;
}

.theme-calm-blue {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.theme-calm-blue .top-bar {
    border-bottom-color: rgba(13, 71, 161, 0.2);
}

.theme-calm-blue .toggle-slider {
    background-color: #90caf9;
}

.theme-calm-blue .btn-fullscreen {
    background-color: #1976d2;
}

/* Sign-up Page Styles */
.signup-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    z-index: 10000;
    overflow-y: auto;
}

.signup-content {
    background: white;
    padding: 0.75rem 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    text-align: center;
    margin: auto;
}

.signup-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 700;
}

.signup-subtitle {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 2rem;
    font-weight: 600;
}

.features-list {
    text-align: left;
    margin: 2.5rem auto 1.5rem auto;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.beta-notice {
    text-align: center;
    background: rgba(90, 103, 216, 0.1);
    border: 2px solid rgba(90, 103, 216, 0.3);
    padding: 1.25rem;
    border-radius: 12px;
    margin: 0 auto 2rem auto;
    max-width: 500px;
}

.beta-notice h3 {
    margin: 0;
    font-size: 1.2rem;
}

.beta-notice p {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

.features-list h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.features-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
}

.signup-actions {
    display: flex;
    gap: 1rem;
    margin: 2.5rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-try-free,
.btn-subscribe,
.btn-subscribe-yearly {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-try-free {
    background-color: #4CAF50;
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-try-free:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-subscribe {
    background-color: #667eea;
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-subscribe:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-subscribe-yearly {
    background-color: #764ba2;
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-subscribe-yearly:hover {
    background-color: #5f3a82;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

.yearly-note {
    color: #555;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    line-height: 1.5;
}

.signup-note {
    color: #666;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .time-display {
        font-size: 4rem;
    }
    
    .break-title {
        font-size: 4rem;
    }
    
    .message-display {
        font-size: 1.5rem;
    }
    
    .controls-group {
        flex-direction: column;
        gap: 1rem;
    }
}

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

.modal-content {
    background-color: white;
    color: black;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

#presetModalTitle {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#presetNameInput {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-buttons .btn {
    flex: 1;
}

.presets-section {
    display: flex;
    gap: 0.5rem;
}

#presetsList {
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.preset-item-info {
    flex: 1;
}

.preset-item-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.preset-item-details {
    font-size: 0.85rem;
    color: #666;
}

.preset-item-buttons {
    display: flex;
    gap: 0.5rem;
}

.preset-item-buttons .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Settings Modal Styles */
.settings-section {
    margin: 2rem 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.settings-section p {
    margin: 0.5rem 0;
    color: #555;
}

.subscription-info {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.subscription-info p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

#subscriptionStatus {
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
}

.settings-note {
    color: #666;
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem 0;
}

.settings-small-note {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-style: italic;
}

#manageSubscriptionSection {
    margin-top: 1rem;
}

#manageSubscriptionSection .btn {
    margin: 0.5rem 0;
}

.settings-section .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

#contactFormContainer {
    margin-top: 1rem;
}

#contactFormContainer label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

#contactFormContainer input,
#contactFormContainer textarea {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

#contactFormContainer textarea {
    min-height: 120px;
    resize: vertical;
}
