/* app\static\css\style.css */

:root {
    --primary: #0F2D6B;
    --primary-light: #254487;
    --white: #ffffff;
    --text-dark: #141414;
    --grey-100: #f7f9fc;
    --grey-400: #d5dbe6;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*  --------------------  TYPOGRAPHY & BODY  -------------------- */
body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: var(--text-dark);
    background-color: var(--grey-100);
    line-height: 1.5;
}

/*  --------------------  BANNER  -------------------- */
.banner {
    background: var(--primary);
    color: var(--white);
}

.banner .wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
}

.banner .logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.banner .title {
    font-size: clamp(1.5rem, 2vw + 1rem, 2.4rem);
    font-weight: 600;
}

.submit-img {
    max-height: 185px;
    margin-right: 8px;
    height: auto;
    width: auto;
    margin-top: -67px;
}

/*  --------------------  EXTERNAL TOOLS BAR  -------------------- */
.external-tools-bar {
    background: var(--white);
    padding: 1.25rem 0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.external-tools-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.external-tools-bar-title {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.external-tools-bar-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.external-tool-bar-btn {
    padding: 0.5rem 1rem;
    background: var(--grey-100);
    border: 1px solid #e2e8f0;
    color: var(--primary);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.external-tool-bar-btn:hover {
    background: #e2e8f0;
    border-color: var(--primary-light);
}

@media (max-width: 968px) {
    .external-tools-bar-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .external-tools-bar-links {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .external-tools-bar-links {
        flex-direction: column;
    }

    .external-tool-bar-btn {
        width: 100%;
        text-align: center;
    }
}

/*  --------------------  LAYOUT  -------------------- */
main {
    max-width: 1400px;
    margin-inline: auto;
    padding: 3rem 2rem;
}

.tool-group + .tool-group {
    margin-top: 3rem;
}

.tool-group h2 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.6rem;
}

/*  --------------------  TOOL GRID & CARDS  -------------------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.6rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    text-decoration: none;
    color: var(--white);
    background: var(--primary);
    border-radius: 0.75rem;
    padding: 1.5rem 1.2rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.tool-card:hover,
.tool-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.8rem;
    object-fit: contain;
}

.tool-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.tool-card p {
    font-size: 0.85rem;
    opacity: 0.95;
}

/*  --------------------  FOOTER  -------------------- */
.footer {
    background: var(--grey-400);
    text-align: center;
    padding: 1rem 0;
    font-size: 0.85rem;
    color: #4f5565;
}

/*  --------------------  ACCESSIBILITY & MEDIA  -------------------- */
@media (prefers-reduced-motion: reduce) {
    .tool-card:hover {
        transform: none;
    }
}

@media (max-width: 600px) {
    .banner .title {
        font-size: 1.7rem;
    }
}

.legal-modal {
    position: fixed;
    inset: 0; /* shorthand for top, right, bottom, left = 0 */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5); /* semi-transparent dark overlay */
    z-index: 1000;
    transition: opacity 0.25s ease;
  }
  
  /* Hide modal when not active */
  .legal-modal[hidden] {
    display: none !important;
  }
  
  /* Modal dialog box */
  .legal-modal__dialog {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    padding: 24px;
    text-align: left;
    animation: fadeInScale 0.25s ease;
    outline: none;
  }
  
  /* Modal title */
  .legal-modal__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #002b45; /* Crowe dark blue */
  }
  
  /* Modal content */
  .legal-modal__content {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.5;
  }
  
  /* Buttons */
  .legal-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }
  
  .legal-modal__btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
  }
  
  .legal-modal__btn--primary {
    background-color: #002b45;
    color: #fff;
  }
  
  .legal-modal__btn--primary:hover {
    background-color: #004b6e;
  }
  
  .legal-modal__btn--secondary {
    background-color: #e0e0e0;
    color: #000;
  }
  
  .legal-modal__btn--secondary:hover {
    background-color: #cacaca;
  }
  
  /* Fade and scale animation */
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

/*  ====================  INDEX PAGE STYLES  ==================== */
/*  Modern homepage design with gradient header and card grid     */

/* Extended CSS Variables for Index Page */
:root {
    --primary-dark: #071a3d;
    --accent: #4a90e2;
    --accent-light: #6ba3e8;
    --success: #10b981;
    --text-muted: #64748b;
    --grey-50: #f8fafc;
    --grey-200: #e2e8f0;
    --grey-800: #1e293b;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --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);
    --gradient: linear-gradient(135deg, #0F2D6B 0%, #254487 100%);
    --gradient-hover: linear-gradient(135deg, #254487 0%, #3a5ba3 100%);
}

/* Header with gradient and modern styling */
.header {
    background: var(--gradient);
    color: var(--white);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.4;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header .logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.header-text h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.3;
}

/* Main content container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Card grid layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

/* Modern tool card design for index page */
.card-grid .tool-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--grey-200);
    position: relative;
    overflow: hidden;
    display: block;
    text-align: left;
}

.card-grid .tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-grid .tool-card:hover::before {
    transform: scaleX(1);
}

.card-grid .tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
    box-shadow: var(--shadow-md);
}

.card-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.card-grid .tool-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.card-grid .tool-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    opacity: 1;
}

/* Badges */
.badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.75rem;
}

.badge-dev {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Index page footer */
.footer {
    background: var(--grey-800);
    color: var(--grey-200);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--white);
}

/* Index page responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Card loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-grid .tool-card {
    animation: fadeIn 0.5s ease forwards;
}

.card-grid .tool-card:nth-child(1) { animation-delay: 0.05s; }
.card-grid .tool-card:nth-child(2) { animation-delay: 0.1s; }
.card-grid .tool-card:nth-child(3) { animation-delay: 0.15s; }
.card-grid .tool-card:nth-child(4) { animation-delay: 0.2s; }
.card-grid .tool-card:nth-child(5) { animation-delay: 0.25s; }
.card-grid .tool-card:nth-child(6) { animation-delay: 0.3s; }