/* =========================
   Global Styles
========================= */
body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    background: #f5f5f5; 
    color: #333; 
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

header { 
    text-align: center; 
    padding: 40px 20px; 
    background: white;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 { 
    margin-bottom: 10px; 
    color: #2c3e50;
    font-size: 2.5rem;
}

h2 { 
    margin: 10px 0 5px; 
    color: #2c3e50;
    font-size: 1.5rem;
}

/* =========================
   Navbar
========================= */
.navbar { 
    background: #333; 
    padding: 15px; 
    text-align: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar a { 
    color: white; 
    margin: 0 10px; 
    text-decoration: none; 
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.navbar a:hover { 
    background-color: #555;
}

/* =========================
   Homepage Tool Grid
========================= */
.tool-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 25px; 
    padding: 20px; 
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card { 
    background: white; 
    padding: 25px 20px; 
    border-radius: 12px; 
    text-align: center; 
    width: 180px; 
    box-shadow: 0 3px 15px rgba(0,0,0,0.1); 
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
}

.tool-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tool-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
}

/* Links inside cards */
.tool-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.tool-card p {
    color: #666;
    font-size: 14px;
    margin: 10px 0 0 0;
}

/* =========================
   Tool Pages (All Tools)
========================= */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.tool-description {
    color: #666;
    font-size: 16px;
    max-width: 600px;
    margin: 10px auto 0 auto;
    text-align: center;
}

/* =========================
   Tool Specific Containers
========================= */
.counter-container,
.converter-container,
.json-container,
.lorem-container {
    width: 100%;
    max-width: 700px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* =========================
   Input Groups and Forms
========================= */
.input-section,
.controls-section {
    width: 100%;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

/* Text Areas */
.text-area {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s;
}

.text-area:focus {
    outline: none;
    border-color: #4CAF50;
}

.code-area {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
}

.output-area {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
}

/* Input Fields */
.number-input,
.select-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.number-input:focus,
.select-input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Date Input */
input[type="date"] {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
}

/* =========================
   Button Styles
========================= */
.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 25px 0;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.generate-btn,
.format-btn,
.validate-btn,
.convert-btn,
.case-btn,
.calculate-btn {
    background-color: #4CAF50;
    color: white;
}

.generate-btn:hover,
.format-btn:hover,
.validate-btn:hover,
.convert-btn:hover,
.case-btn:hover,
.calculate-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

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

.copy-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
}

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

.clear-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

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

.swap-btn:hover {
    background-color: #F57C00;
    transform: translateY(-2px);
}

/* Case Converter Specific Buttons */
.uppercase-btn { background-color: #2196F3; }
.lowercase-btn { background-color: #4CAF50; }
.titlecase-btn { background-color: #FF9800; }
.sentencecase-btn { background-color: #9C27B0; }

.uppercase-btn:hover { background-color: #1976D2; }
.lowercase-btn:hover { background-color: #45a049; }
.titlecase-btn:hover { background-color: #F57C00; }
.sentencecase-btn:hover { background-color: #7B1FA2; }

/* =========================
   Result Sections
========================= */
.result-section,
.output-section {
    width: 100%;
    margin-top: 20px;
}

.result-card {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #4CAF50;
}

.result-label {
    font-weight: bold;
    color: #2c3e50;
    margin-right: 10px;
}

.result-value {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

.result-unit {
    font-size: 18px;
    color: #666;
    margin-left: 5px;
}

.conversion-details {
    margin-top: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* =========================
   Statistics Grid (Word Counter)
========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
    width: 100%;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: bold;
}

/* =========================
   Status Messages
========================= */
.status-message {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

#statusText {
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
}

#statusText.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#statusText.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#statusText.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.age-result,
.json-result,
.lorem-result,
.counter-result {
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

/* =========================
   Footer Styles
========================= */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4CAF50;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #34495e;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: #4CAF50;
    transform: translateY(-2px);
}

/* Input Row for Unit Converter */
.input-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.input-row .input-group {
    flex: 1;
}

/* =========================
   Ad Container Styles
========================= */

.ad-container {
    margin: 20px auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px; /* Increased for better visibility */
    background-color: #f8f9fa; /* Light background to see containers */
    border: 1px dashed #ddd; /* Dashed border to see container boundaries */
    border-radius: 8px;
}

.header-banner {
    margin: 0 auto 30px auto;
    min-height: 90px;
}

.middle-banner {
    grid-column: 1 / -1;
    margin: 30px 0;
    width: 100%;
    min-height: 250px;
}

.footer-banner {
    margin: 30px auto;
    min-height: 90px;
}
/* =========================
   Responsive Design
========================= */
@media (max-width: 768px) {
    .tool-card {
        width: calc(50% - 20px);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .button-group button {
        width: 100%;
        max-width: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Responsive ad containers */
    .ad-container {
        margin: 15px auto;
    }
    
    .middle-banner {
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .tool-card {
        width: 100%;
        max-width: 280px;
    }

    .navbar a {
        display: block;
        margin: 5px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .counter-container,
    .converter-container,
    .json-container,
    .lorem-container {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    /* Mobile ad containers */
    .ad-container {
        margin: 10px auto;
    }
}