/* ============================================
   WORO BORO - Mobile-First Responsive Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary-blue: #1a4c8f;
    --primary-green: #4CAF50;
    --dark-green: #2E7D32;
    --purple: #7c3aed;
    --pink: #ec4899;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --amber-600: #d97706;
    --amber-900: #78350f;
    --green-900: #14532d;
    --green-950: #052e16;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-400: #9ca3af;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red-600: #dc2626;
    --blue-600: #2563eb;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

html {
    height: 100%;
    height: -webkit-fill-available;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #000000;
    color: #4CAF50;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px !important;
    }
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Container */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    max-width: 100%;
    width: 100%;
}

/* Logo & Branding */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

.app-subtitle {
    color: #4CAF50;
    font-size: 1rem;
    opacity: 0.8;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #4CAF50;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.status-icon.connected {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-icon.disconnected {
    background: #6b7280;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.5);
}

/* Forms */
.login-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4CAF50;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    color: #4CAF50;
    font-size: 16px; /* Prevent iOS zoom */
    transition: all 0.2s;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(76, 175, 80, 0.5);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px; /* Touch target size */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(138, 43, 226, 0.3);
}

.btn:disabled {
    background: #6b7280 !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #2563eb;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    background: #2563eb;
    color: #ffffff;
}

.btn-large:hover:not(:disabled) {
    background: #1d4ed8;
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.btn-success {
    background: #2563eb;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-danger {
    background: #6b7280;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #4b5563;
}

.icon-btn {
    padding: 0.5rem;
    background: rgba(107, 114, 128, 0.3);
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.2s;
}

.icon-btn:hover:not(:disabled) {
    background: rgba(107, 114, 128, 0.5);
    color: #ffffff;
}

.icon-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.icon-btn:disabled {
    background: #6b7280;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Tip Box */
.tip-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #4CAF50;
    max-width: 400px;
    width: 100%;
}

/* Board Header */
.board-header {
    padding: 1rem;
    background: #000000;
    border-bottom: 1px solid #4CAF50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.user-info,
.users-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4CAF50;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-indicator {
    color: #10b981;
}

.connection-indicator.offline {
    color: #6b7280;
}

.bot-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4CAF50;
}

/* Board Container */
.board-container {
    flex: 1;
    padding: 1rem;
    display: flex;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.board-content {
    width: 100%;
    max-width: 1200px;
}

.board-header-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.room-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 0.5rem;
}

.room-subtitle {
    color: #4CAF50;
    font-size: 0.875rem;
    opacity: 0.8;
}

.bot-typing-indicator {
    margin-top: 0.5rem;
    color: #fbbf24;
    font-size: 0.875rem;
    animation: pulse 2s infinite;
}

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

/* Message Board */
.message-board {
    background: #000000;
    border-radius: 12px;
    border: 2px solid #4CAF50;
    padding: 1.5rem;
    min-height: 300px;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.other-user-editing {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(37, 99, 235, 0.9);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 500px;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.message-content p {
    font-size: 1.5rem;
    color: #4CAF50;
    text-align: center;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    font-weight: 500;
    max-width: 100%;
}

.empty-message {
    color: rgba(76, 175, 80, 0.5) !important;
    font-style: italic;
    font-size: 1.25rem !important;
}

.message-author {
    text-align: right;
    margin-top: 1rem;
    color: rgba(76, 175, 80, 0.7);
    font-size: 0.875rem;
    font-style: italic;
}

/* Edit Section */
.edit-section {
    margin-top: 1.5rem;
}

.edit-section textarea {
    width: 100%;
    padding: 1rem;
    background: #000000;
    color: #4CAF50;
    border-radius: 8px;
    font-size: 16px; /* Prevent iOS zoom */
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    border: 2px solid #4CAF50;
    transition: all 0.2s;
}

.edit-section textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3);
}

.edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.write-section {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* How It Works */
.how-it-works {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4CAF50;
    border-radius: 12px;
    margin: 1rem;
}

.how-it-works h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.how-it-works ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.how-it-works li {
    font-size: 0.875rem;
    color: #4CAF50;
    opacity: 0.9;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #000000;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
    position: relative;
    color: #4CAF50;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.modal-description {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.link-display {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.875rem;
    color: #4CAF50;
}

.modal-footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(76, 175, 80, 0.7);
    text-align: center;
}

/* Video Ad Modal */
.video-ad-content {
    max-width: 90vw;
    aspect-ratio: 16/9;
    padding: 0;
    overflow: hidden;
}

.video-ad-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, var(--dark-green) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.video-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.video-ad-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.video-ad-placeholder p {
    font-size: 1rem;
    color: #4CAF50;
}

#adComplete {
    color: #4CAF50;
    font-weight: 600;
}

/* Footer Counter */
.footer-counter {
    background: #000000;
    border-top: 1px solid #4CAF50;
    padding: 1rem;
    text-align: center;
}

.counter-label {
    font-size: 0.875rem;
    color: rgba(76, 175, 80, 0.8);
    margin-bottom: 0.25rem;
}

.counter-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #4CAF50;
    animation: pulse 2s infinite;
}

.counter-note {
    font-size: 0.75rem;
    color: rgba(76, 175, 80, 0.6);
    margin-top: 0.25rem;
}

/* Animations - Removed fadeIn, using letter-by-letter typing effect instead */

/* Safe Area Support (iPhone notch) */
@supports (padding: max(0px)) {
    .container,
    .board-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .board-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Responsive Design */
@media (min-width: 640px) {
    .app-title {
        font-size: 3rem;
    }
    
    .room-title {
        font-size: 2rem;
    }
    
    .message-content p {
        font-size: 2rem;
    }
    
    .board-header {
        flex-wrap: nowrap;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .login-form {
        max-width: 500px;
    }
    
    .board-content {
        padding: 1rem;
    }
    
    .message-board {
        min-height: 400px;
        padding: 2rem;
    }
    
    .message-content {
        min-height: 250px;
    }
    
    .modal-content {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .board-container {
        padding: 2rem;
    }
    
    .message-board {
        min-height: 500px;
        padding: 2.5rem;
    }
    
    .message-content {
        min-height: 400px;
        max-height: 600px;
    }
    
    .message-content p {
        font-size: 2rem;
    }
    
    .edit-section textarea {
        min-height: 200px;
        font-size: 1.25rem;
        padding: 1.5rem;
    }
}

/* Extra large desktop screens */
@media (min-width: 1400px) {
    .message-board {
        min-height: 600px;
        padding: 3rem;
    }
    
    .message-content {
        min-height: 500px;
        max-height: 700px;
    }
    
    .message-content p {
        font-size: 2.5rem;
    }
    
    .edit-section textarea {
        min-height: 250px;
        font-size: 1.5rem;
        padding: 2rem;
    }
    
    .empty-message {
        font-size: 2rem !important;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    .logo-container {
        margin-bottom: 1rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .message-board {
        min-height: 200px;
    }
}

/* Legal Links */
.legal-links {
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
}

.legal-links a {
    color: rgba(76, 175, 80, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: #4CAF50;
    text-decoration: underline;
}

.legal-links span {
    color: rgba(76, 175, 80, 0.4);
    margin: 0 0.5rem;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .screen {
        display: block;
    }
    
    .btn,
    .icon-btn {
        display: none;
    }
}

/* ============================================
   BANNER ADS STYLES
   ============================================ */

/* Base Banner Ad Styles */
.banner-ad {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    overflow: hidden;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.ad-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    text-align: center;
}

.ad-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
}

.ad-demo {
    color: #ff6600;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

/* Left Banner Ad - Desktop Only */
.banner-ad-left {
    display: none;
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 100;
}

/* Right Banner Ad - Desktop Only */
.banner-ad-right {
    display: none;
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 100;
}

/* Bottom Banner Ad - All Devices */
.banner-ad-bottom {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 1rem auto;
    display: flex;
}

/* Mobile - Bottom Banner */
@media (max-width: 767px) {
    .banner-ad-bottom {
        max-width: 320px;
        height: 100px;
    }
    
    .banner-ad-left,
    .banner-ad-right {
        display: none !important;
    }
}

/* Tablet - Show smaller side banners */
@media (min-width: 768px) and (max-width: 1199px) {
    .banner-ad-left,
    .banner-ad-right {
        display: none;
    }
    
    .banner-ad-bottom {
        max-width: 728px;
        height: 90px;
    }
}

/* Desktop - Show all banners */
@media (min-width: 1200px) {
    .banner-ad-left,
    .banner-ad-right {
        display: flex;
    }
    
    /* Adjust main content to not overlap with side banners */
    #boardScreen .board-container {
        max-width: calc(100% - 380px);
        margin: 0 auto;
    }
    
    .banner-ad-bottom {
        max-width: 728px;
        height: 90px;
    }
}

/* Large Desktop - Bigger side banners */
@media (min-width: 1400px) {
    .banner-ad-left,
    .banner-ad-right {
        width: 300px;
        height: 600px;
    }
    
    #boardScreen .board-container {
        max-width: calc(100% - 660px);
    }
}

/* Ad hover effect */
.banner-ad:hover {
    border-color: #ff6600;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
}
